Skip to content

Commit

Permalink
spotless fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aastha25 committed Dec 13, 2023
1 parent 3a7e7af commit 5288845
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
package com.linkedin.coral.schema.avro;

import com.linkedin.coral.hive.hive2rel.functions.OrdinalReturnTypeInferenceV2;
import java.util.Deque;
import java.util.HashMap;
import java.util.LinkedList;
Expand Down Expand Up @@ -60,6 +59,7 @@
import com.linkedin.coral.com.google.common.base.Preconditions;
import com.linkedin.coral.common.HiveMetastoreClient;
import com.linkedin.coral.common.HiveUncollect;
import com.linkedin.coral.hive.hive2rel.functions.OrdinalReturnTypeInferenceV2;


/**
Expand Down Expand Up @@ -443,8 +443,7 @@ public RexNode visitCall(RexCall rexCall) {
* use the field's schema as is.
*/
if (rexCall.getOperator().getReturnTypeInference() instanceof OrdinalReturnTypeInferenceV2) {
int index = ((OrdinalReturnTypeInferenceV2) rexCall.getOperator().getReturnTypeInference())
.getOrdinal();
int index = ((OrdinalReturnTypeInferenceV2) rexCall.getOperator().getReturnTypeInference()).getOrdinal();
RexNode operand = rexCall.operands.get(index);

if (operand instanceof RexInputRef) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1106,8 +1106,10 @@ public void testDivideReturnType() {
public void testCastNullabilityUDF() {
ViewToAvroSchemaConverter viewToAvroSchemaConverter = ViewToAvroSchemaConverter.create(hiveMetastoreClient);

Schema schemaWithUDF = viewToAvroSchemaConverter.toAvroSchema("SELECT cast_nullability(Struct_Col, Struct_Col) AS modCol FROM basecomplexnonnullable");
Schema schemaWithField = viewToAvroSchemaConverter.toAvroSchema("SELECT Struct_Col AS modCol FROM basecomplexnonnullable");
Schema schemaWithUDF = viewToAvroSchemaConverter
.toAvroSchema("SELECT cast_nullability(Struct_Col, Struct_Col) AS modCol FROM basecomplexnonnullable");
Schema schemaWithField =
viewToAvroSchemaConverter.toAvroSchema("SELECT Struct_Col AS modCol FROM basecomplexnonnullable");

Assert.assertEquals(schemaWithUDF.toString(true), TestUtils.loadSchema("testCastNullabilityUDF-expected.avsc"));
Assert.assertEquals(schemaWithField.toString(true), TestUtils.loadSchema("testCastNullabilityUDF-expected.avsc"));
Expand Down

0 comments on commit 5288845

Please sign in to comment.