Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public static RelDataType convert(PrimitiveTypeInfo type, RelDataTypeFactory dtF
convertedType = dtFactory.createSqlType(SqlTypeName.TIMESTAMP, 9);
break;
case BINARY:
convertedType = dtFactory.createSqlType(SqlTypeName.BINARY);
convertedType = dtFactory.createSqlType(SqlTypeName.VARBINARY);
break;
case DECIMAL:
DecimalTypeInfo dtInf = (DecimalTypeInfo) type;
Expand Down Expand Up @@ -289,6 +289,7 @@ private static TypeInfo convertPrimitiveType(RelDataType rType) {
case INTERVAL_SECOND:
return hiveShim.getIntervalDayTimeTypeInfo();
case BINARY:
case VARBINARY:
return TypeInfoFactory.binaryTypeInfo;
Copy link
Contributor

@Myracle Myracle May 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find that there exist other types which are not present in flink code, for example, REAL, TIME_WITH_LOCAL_TIME_ZONE. Should we also add them?

Copy link
Contributor Author

@luoyuxia luoyuxia May 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your reminer.
Yes, we also should all them. And we have also a jira for TIME_WITH_LOCAL_TIME_ZONE FLINK-23224.
I will support it in other pr.

case DECIMAL:
return TypeInfoFactory.getDecimalTypeInfo(rType.getPrecision(), rType.getScale());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public static void setup() throws Exception {
tableEnv.executeSql("CREATE TABLE src (key STRING, value STRING)");
tableEnv.executeSql(
"CREATE TABLE srcpart (key STRING, `value` STRING) PARTITIONED BY (ds STRING, hr STRING)");
tableEnv.executeSql("create table binary_t (a int, ab array<binary>)");

tableEnv.executeSql(
"CREATE TABLE nested (\n"
+ " a int,\n"
Expand Down Expand Up @@ -156,7 +158,8 @@ public void testAdditionalQueries() throws Exception {
+ "(partition by dep order by salary desc) as rnk from employee) a where rnk=1",
"select salary,sum(cnt) over (order by salary)/sum(cnt) over "
+ "(order by salary ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from"
+ " (select salary,count(*) as cnt from employee group by salary) a"));
+ " (select salary,count(*) as cnt from employee group by salary) a",
"select a, one from binary_t lateral view explode(ab) abs as one where a > 0"));
if (HiveVersionTestUtil.HIVE_230_OR_LATER) {
toRun.add(
"select weekofyear(current_timestamp()), dayofweek(current_timestamp()) from src limit 1");
Expand Down