Flink: Support inspecting table#6222
Conversation
|
@stevenzwu @openinx @rdblue @Fokko could you please take a look at it when you get a chance? thx. |
|
also cc @pvary, thx. |
|
@hililiwei: Hive/Spark/Impala(?) uses Do we want to introduce a different naming convention for Flink? How widespread is the usage of the |
@pvary, thank you for your feedback. |
Thanks @hililiwei! |
|
Missclicked 😢 What I was trying to comment: The issues are handled on Core level, but it might worth to add some checks for edge cases too. Like:
|
40aeedd to
ad1f420
Compare
|
@hililiwei we should add comprehensive unit test for I have some internal DataGenerators for unit test code with very comprehensive coverage all field types (including complex nested types). Maybe I will submit a separate PR for that, which will cover Flink |
| // make a defensive copy to ensure entries do not change | ||
| List<Map.Entry<?, ?>> entries = ImmutableList.copyOf(map.entrySet()); | ||
|
|
||
| ArrayData keyArray = |
There was a problem hiding this comment.
ok. I got it that we need run the conversion recursively (e.g. for StringData key or RowData value). I like to propose a diff structure for this class.
We can repurpose collectionToArrayData to a convertFromStructToRowData(Type type, Object value) method. If type is most primitive, it should be simple pass-thru. for other types (like timestamp, struct, map, array) there are some conversions to Flink types (like TimestampData, RowData, MapData, ArrayData).
Then for the map, we don't have to convert to key and value array. I believe the reason you did it is to reuse the collectionToArrayData.
f701467 to
6f40b74
Compare
That would be great. I'm also thinking of adding UT for it. So i'll do it based on your code. |
|
UT failed because of #5376. I'm trying to fix it. |
d62a614 to
3e9267a
Compare
f4a168c to
8dd0688
Compare
|
Added test case for StructRowData. @stevenzwu please take a look, thx. |
6fe3594 to
d566549
Compare
|
7b08642 to
09dca6b
Compare
|
thanks @hililiwei for contributing this major feature |
|
thanks @stevenzwu @pvary @szehon-ho |
What is the purpose of the change
Support inspecting table in flink sql.
The '$' syntax borrows from Flink-Table-Store, under the Flink umbrella.
List
To show table history:
To show table metadata log entries:
To show the valid snapshots for a table:
To show a table's current data files:
To show a table's current file manifests:
To show a table's current partitions:
These tables are unions of the metadata tables specific to the current snapshot, and return metadata across all snapshots.
To show all of the table's data files and each file's metadata:
To show all of the table's manifest files:
To show a table's known snapshot references: