slinkydeveloper commented on a change in pull request #17350:
URL: https://github.com/apache/flink/pull/17350#discussion_r716431275
##########
File path:
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/filesystem/AbstractFileSystemTable.java
##########
@@ -59,15 +68,19 @@ ReadableConfig formatOptions(String identifier) {
return new DelegatingConfiguration(tableOptions, identifier + ".");
}
- DataType getFormatDataType() {
- TableSchema.Builder builder = TableSchema.builder();
- schema.getTableColumns()
- .forEach(
- column -> {
- if (!partitionKeys.contains(column.getName())) {
- builder.add(column);
- }
- });
- return builder.build().toRowDataType();
+ DataType getRowDataTypeWithoutPartitionColumns() {
Review comment:
TBH I find less convoluted the committed code than extracting the info
from `getRowDataType()`:
```java
FieldsDataType fieldsDataType = (FieldsDataType) getRowDataType();
RowType rowType = (RowType) getRowDataType().getLogicalType();
return ROW(
IntStream.range(0, rowType.getFieldCount())
.filter(i ->
!partitionKeys.contains(rowType.getFieldNames().get(i)))
.mapToObj(i ->
DataTypes.FIELD(rowType.getFieldNames().get(i),
fieldsDataType.getChildren().get(i)))
.toArray(DataTypes.Field[]::new)
);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]