Source:
<code>private RelDataType getRowType(RelDataTypeFactory typeFactory, CatalogBaseTable catalogBaseTable, boolean isStreamingMode) { final FlinkTypeFactory flinkTypeFactory = (FlinkTypeFactory) typeFactory; TableSchema tableSchema = catalogBaseTable.getSchema(); final DataType[] fieldDataTypes = tableSchema.getFieldDataTypes(); if (!isStreamingMode && catalogBaseTable instanceof ConnectorCatalogTable && ((ConnectorCatalogTable) catalogBaseTable).getTableSource().isPresent()) { for (int i = 0; i < fieldDataTypes.length; i++) { LogicalType lt = fieldDataTypes[i].getLogicalType(); if (lt instanceof TimestampType && (((TimestampType) lt).getKind() == TimestampKind.PROCTIME || ((TimestampType) lt).getKind() == TimestampKind.ROWTIME)) { int precision = ((TimestampType) lt).getPrecision(); fieldDataTypes[i] = DataTypes.TIMESTAMP(precision); } } } <START> Optional<TableSource> sourceOpt = findAndCreateTableSource(new TableConfig().getConfiguration()); <END> if (tableSchema.getTableColumns().stream().noneMatch(TableColumn::isGenerated) && tableSchema.getWatermarkSpecs().isEmpty() && sourceOpt.isPresent()) { TableSource source = sourceOpt.get(); if ((source instanceof DefinedProctimeAttribute && ((DefinedProctimeAttribute) source).getProctimeAttribute() != null) || (source instanceof DefinedRowtimeAttributes && ((DefinedRowtimeAttributes) source).getRowtimeAttributeDescriptors() != null && !((DefinedRowtimeAttributes) source).getRowtimeAttributeDescriptors().isEmpty())) { tableSchema = ConnectorCatalogTable.calculateSourceSchema(source, !isStreamingMode); } } return TableSourceUtil.getSourceRowType(flinkTypeFactory, tableSchema, scala.Option.empty(), isStreamingMode); }</code><technical_language>suggestion Optional<TableSource<?>> sourceOpt = findAndCreateTableSource(new TableConfig().getConfiguration()); Add <?> TableSource avoid IDEA warning</technical_language>

Target:
private RelDataType getRowType(RelDataTypeFactory typeFactory, CatalogBaseTable catalogBaseTable, boolean isStreamingMode) { final FlinkTypeFactory flinkTypeFactory = (FlinkTypeFactory) typeFactory; TableSchema tableSchema = catalogBaseTable.getSchema(); final DataType[] fieldDataTypes = tableSchema.getFieldDataTypes(); if (!isStreamingMode && catalogBaseTable instanceof ConnectorCatalogTable && ((ConnectorCatalogTable) catalogBaseTable).getTableSource().isPresent()) { for (int i = 0; i < fieldDataTypes.length; i++) { LogicalType lt = fieldDataTypes[i].getLogicalType(); if (lt instanceof TimestampType && (((TimestampType) lt).getKind() == TimestampKind.PROCTIME || ((TimestampType) lt).getKind() == TimestampKind.ROWTIME)) { int precision = ((TimestampType) lt).getPrecision(); fieldDataTypes[i] = DataTypes.TIMESTAMP(precision); } } } Optional<TableSource<?>> sourceOpt = findAndCreateTableSource(); if (isStreamingMode && tableSchema.getTableColumns().stream().noneMatch(TableColumn::isGenerated) && tableSchema.getWatermarkSpecs().isEmpty() && sourceOpt.isPresent()) { TableSource<?> source = sourceOpt.get(); if (TableSourceValidation.hasProctimeAttribute(source) || TableSourceValidation.hasRowtimeAttribute(source)) { tableSchema = ConnectorCatalogTable.calculateSourceSchema(source, false); } } return TableSourceUtil.getSourceRowType(flinkTypeFactory, tableSchema, scala.Option.empty(), isStreamingMode); }