|
44 | 44 | import org.apache.commons.collections.CollectionUtils; |
45 | 45 | import org.apache.commons.lang3.StringUtils; |
46 | 46 | import org.apache.flink.api.common.typeinfo.BasicTypeInfo; |
| 47 | +import org.apache.flink.api.common.typeinfo.LocalTimeTypeInfo; |
47 | 48 | import org.apache.flink.api.common.typeinfo.TypeInformation; |
48 | 49 | import org.apache.flink.api.java.typeutils.RowTypeInfo; |
49 | 50 | import org.apache.flink.streaming.api.datastream.DataStream; |
|
54 | 55 | import org.apache.flink.table.catalog.ObjectIdentifier; |
55 | 56 | import org.apache.flink.table.runtime.typeutils.BaseRowTypeInfo; |
56 | 57 | import org.apache.flink.table.runtime.typeutils.BigDecimalTypeInfo; |
| 58 | +import org.apache.flink.table.runtime.typeutils.LegacyLocalDateTimeTypeInfo; |
57 | 59 | import org.apache.flink.table.types.logical.DecimalType; |
58 | 60 | import org.apache.flink.table.types.logical.LegacyTypeInformationType; |
59 | 61 | import org.apache.flink.table.types.logical.LogicalType; |
| 62 | +import org.apache.flink.table.types.logical.TimestampType; |
60 | 63 | import org.apache.flink.table.typeutils.TimeIndicatorTypeInfo; |
61 | 64 | import org.apache.flink.types.Row; |
62 | 65 | import org.slf4j.Logger; |
@@ -387,6 +390,11 @@ private void joinFun(Object pollObj, |
387 | 390 | ((LegacyTypeInformationType<?>) logicalTypes[i]).getTypeInformation().getClass().equals(BigDecimalTypeInfo.class)) { |
388 | 391 | logicalTypes[i] = new DecimalType(38, 18); |
389 | 392 | } |
| 393 | + |
| 394 | + if (logicalTypes[i] instanceof LegacyTypeInformationType && |
| 395 | + (((LegacyTypeInformationType<?>) logicalTypes[i]).getTypeInformation().getClass().equals(LegacyLocalDateTimeTypeInfo.class))) { |
| 396 | + logicalTypes[i] = new TimestampType(TimestampType.MAX_PRECISION); |
| 397 | + } |
390 | 398 | } |
391 | 399 |
|
392 | 400 | BaseRowTypeInfo leftBaseTypeInfo = new BaseRowTypeInfo(logicalTypes, leftTable.getSchema().getFieldNames()); |
@@ -425,11 +433,15 @@ private void joinFun(Object pollObj, |
425 | 433 | targetTable = localTableCache.get(joinInfo.getLeftTableName()); |
426 | 434 | } |
427 | 435 |
|
428 | | - TypeInformation[] fieldDataTypes = targetTable.getSchema().getFieldTypes(); |
| 436 | + TypeInformation<?>[] fieldDataTypes = targetTable.getSchema().getFieldTypes(); |
429 | 437 | for (int i = 0; i < fieldDataTypes.length; i++) { |
430 | 438 | if (fieldDataTypes[i].getClass().equals(BigDecimalTypeInfo.class)) { |
431 | 439 | fieldDataTypes[i] = BasicTypeInfo.BIG_DEC_TYPE_INFO; |
432 | 440 | } |
| 441 | + |
| 442 | + if (fieldDataTypes[i].getClass().equals(LegacyLocalDateTimeTypeInfo.class)) { |
| 443 | + fieldDataTypes[i] = LocalTimeTypeInfo.LOCAL_DATE_TIME; |
| 444 | + } |
433 | 445 | } |
434 | 446 |
|
435 | 447 | RowTypeInfo typeInfo = new RowTypeInfo(fieldDataTypes, targetTable.getSchema().getFieldNames()); |
|
0 commit comments