Skip to content

Commit

Permalink
[fixup] Reverted null casing change
Browse files Browse the repository at this point in the history
Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
  • Loading branch information
slinkydeveloper committed Nov 8, 2021
1 parent 41d3424 commit 0fe4cd3
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private ArrayToStringCastRule() {
result$2 = org.apache.flink.table.data.binary.BinaryStringData.fromString("" + element$3);
builder$1.append(result$2);
} else {
builder$1.append("NULL");
builder$1.append("null");
}
}
builder$1.append("]");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
/** This class contains a set of utilities to develop {@link CastRule}. */
final class CastRuleUtils {

static final String NULL_STR_LITERAL = strLiteral("NULL");
static final String NULL_STR_LITERAL = strLiteral("null");
static final String EMPTY_STR_LITERAL = "\"\"";

static String staticCall(Method staticMethod, Object... args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ private MapToStringCastRule() {
key$5 = ((org.apache.flink.table.data.binary.BinaryStringData) keys$2.getString(i$4));
builder$1.append(key$5);
} else {
builder$1.append("NULL");
builder$1.append("null");
}
builder$1.append("=");
if (!valueIsNull$8) {
value$7 = values$3.getInt(i$4);
result$2 = org.apache.flink.table.data.binary.BinaryStringData.fromString(org.apache.flink.table.utils.DateTimeUtils.intervalYearMonthToString(value$7));
builder$1.append(result$2);
} else {
builder$1.append("NULL");
builder$1.append("null");
}
}
builder$1.append("}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static boolean matches(LogicalType input, LogicalType target) {
result$2 = org.apache.flink.table.data.binary.BinaryStringData.fromString("" + f0Value$2);
builder$1.append(result$2);
} else {
builder$1.append("NULL");
builder$1.append("null");
}
builder$1.append(",");
org.apache.flink.table.data.binary.BinaryStringData f1Value$4 = org.apache.flink.table.data.binary.BinaryStringData.EMPTY_UTF8;
Expand All @@ -82,7 +82,7 @@ private static boolean matches(LogicalType input, LogicalType target) {
f1Value$4 = ((org.apache.flink.table.data.binary.BinaryStringData) _myInput.getString(1));
builder$1.append(f1Value$4);
} else {
builder$1.append("NULL");
builder$1.append("null");
}
builder$1.append(")");
result$1 = org.apache.flink.table.data.binary.BinaryStringData.fromString(builder$1.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Stream<CastTestSpecBuilder> testCases() {
.fromCase(
ARRAY(INT().nullable()),
new GenericArrayData(new Integer[] {null, 456}),
StringData.fromString("[NULL, 456]"))
StringData.fromString("[null, 456]"))
.fromCase(
ARRAY(INT()),
new GenericArrayData(new Integer[] {}),
Expand All @@ -213,11 +213,11 @@ Stream<CastTestSpecBuilder> testCases() {
.fromCase(
MAP(STRING().nullable(), INTERVAL(MONTH()).nullable()),
mapData(entry(null, -123), entry(StringData.fromString("b"), null)),
StringData.fromString("{NULL=-10-03, b=NULL}"))
StringData.fromString("{null=-10-03, b=null}"))
.fromCase(
MAP(STRING().nullable(), INTERVAL(MONTH()).nullable()),
mapData(entry(null, null)),
StringData.fromString("{NULL=NULL}"))
StringData.fromString("{null=null}"))
.fromCase(
MAP(STRING(), INTERVAL(MONTH())),
mapData(),
Expand All @@ -229,7 +229,7 @@ Stream<CastTestSpecBuilder> testCases() {
.fromCase(
ROW(FIELD("f0", INT().nullable()), FIELD("f1", STRING())),
GenericRowData.of(null, StringData.fromString("abc")),
StringData.fromString("(NULL,abc)"))
StringData.fromString("(null,abc)"))
.fromCase(ROW(), GenericRowData.of(), StringData.fromString("()"))
.fromCase(
RAW(LocalDateTime.class, new LocalDateTimeSerializer()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ class ArrayTypeTest extends ArrayTypeTestBase {
array(nullOf(DataTypes.INT), 1),
"array(Null(INT), 1)",
"ARRAY[NULLIF(1,1), 1]",
"[NULL, 1]")
"[null, 1]")

testAllApis(
array(array(nullOf(DataTypes.INT), 1)),
"array(array(Null(INT), 1))",
"ARRAY[ARRAY[NULLIF(1,1), 1]]",
"[[NULL, 1]]")
"[[null, 1]]")

// implicit conversion
testTableApi(
Expand Down Expand Up @@ -178,13 +178,13 @@ class ArrayTypeTest extends ArrayTypeTestBase {
array('f0, 'f1),
"array(f0, f1)",
"ARRAY[f0, f1]",
"[NULL, 42]")
"[null, 42]")

testAllApis(
array('f0, 'f1),
"array(f0, f1)",
"ARRAY[f0, f1]",
"[NULL, 42]")
"[null, 42]")

testAllApis(
'f2,
Expand All @@ -202,13 +202,13 @@ class ArrayTypeTest extends ArrayTypeTestBase {
'f5,
"f5",
"f5",
"[[1, 2, 3], NULL]")
"[[1, 2, 3], null]")

testAllApis(
'f6,
"f6",
"f6",
"[1, NULL, NULL, 4]")
"[1, null, null, 4]")

testAllApis(
'f2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class MapTypeTest extends MapTypeTestBase {
map(1, nullOf(DataTypes.INT)),
"map(1, Null(INT))",
"map[1, NULLIF(1,1)]",
"{1=NULL}")
"{1=null}")

// explicit conversion
testAllApis(
Expand Down Expand Up @@ -162,7 +162,7 @@ class MapTypeTest extends MapTypeTestBase {
map('f1.at("a"), 'f5),
"map(f1.at('a'), f5)",
"MAP[f1['a'], f5]",
"{NULL=12}")
"{null=12}")

testAllApis(
'f1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class RowTypeTest extends RowTypeTestBase {
row(1 + 1, 2 * 3, nullOf(DataTypes.STRING())),
"row(1 + 1, 2 * 3, Null(STRING))",
"ROW(1 + 1, 2 * 3, NULLIF(1, 1))",
"(2,6,NULL)"
"(2,6,null)"
)

testSqlApi("(1, 'foo', true)", "(1,foo,true)")
Expand All @@ -73,7 +73,7 @@ class RowTypeTest extends RowTypeTestBase {
row('f0, 'f1),
"row(f0, f1)",
"(f0, f1)",
"(NULL,1)"
"(null,1)"
)

testAllApis(
Expand All @@ -87,7 +87,7 @@ class RowTypeTest extends RowTypeTestBase {
row('f2, 'f5),
"row(f2, f5)",
"(f2, f5)",
"((2,foo,true),(foo,NULL))"
"((2,foo,true),(foo,null))"
)

testAllApis(
Expand Down

0 comments on commit 0fe4cd3

Please sign in to comment.