[KYUUBI #3727] Extract the common variables of GetTables in flink and spark to ResultSetSchemaConstant

### _Why are the changes needed?_

fix #3727

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #3729 from jiaoqingbo/kyuubi3727.

Closes #3727

cb494c82 [jiaoqingbo] [KYUUBI #3727] Extract the common variables of GetTables in flink and spark to ResultSetSchemaConstant

Authored-by: jiaoqingbo <1178404354@qq.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
jiaoqingbo 2022-10-31 13:36:10 +00:00 committed by Cheng Pan
parent fa9f626ee6
commit a5d7d72628
3 changed files with 31 additions and 10 deletions

View File

@ -80,11 +80,11 @@ class GetTables(
Column.physical(TABLE_NAME, DataTypes.STRING),
Column.physical(TABLE_TYPE, DataTypes.STRING),
Column.physical(REMARKS, DataTypes.STRING),
Column.physical("TYPE_CAT", DataTypes.STRING),
Column.physical("TYPE_SCHEM", DataTypes.STRING),
Column.physical("TYPE_NAME", DataTypes.STRING),
Column.physical("SELF_REFERENCING_COL_NAME", DataTypes.STRING),
Column.physical("REF_GENERATION", DataTypes.STRING))
Column.physical(TYPE_CAT, DataTypes.STRING),
Column.physical(TYPE_SCHEM, DataTypes.STRING),
Column.physical(TYPE_NAME, DataTypes.STRING),
Column.physical(SELF_REFERENCING_COL_NAME, DataTypes.STRING),
Column.physical(REF_GENERATION, DataTypes.STRING))
.data(tables)
.build
} catch onError()

View File

@ -47,16 +47,16 @@ class GetTables(
.add(TABLE_NAME, "string", nullable = true, "Table name.")
.add(TABLE_TYPE, "string", nullable = true, "The table type, e.g. \"TABLE\", \"VIEW\"")
.add(REMARKS, "string", nullable = true, "Comments about the table.")
.add("TYPE_CAT", "string", nullable = true, "The types catalog.")
.add("TYPE_SCHEM", "string", nullable = true, "the types schema (may be null)")
.add("TYPE_NAME", "string", nullable = true, "Type name.")
.add(TYPE_CAT, "string", nullable = true, "The types catalog.")
.add(TYPE_SCHEM, "string", nullable = true, "the types schema (may be null)")
.add(TYPE_NAME, "string", nullable = true, "Type name.")
.add(
"SELF_REFERENCING_COL_NAME",
SELF_REFERENCING_COL_NAME,
"string",
nullable = true,
"Name of the designated \"identifier\" column of a typed table.")
.add(
"REF_GENERATION",
REF_GENERATION,
"string",
nullable = true,
"Specifies how values in SELF_REFERENCING_COL_NAME are created.")

View File

@ -187,4 +187,25 @@ object ResultSetSchemaConstant {
* for example with overload functions
*/
final val SPECIFIC_NAME = "SPECIFIC_NAME"
/**
* String => The types catalog.
*/
final val TYPE_CAT = "TYPE_CAT"
/**
* String => the types schema (may be null).
*/
final val TYPE_SCHEM = "TYPE_SCHEM"
/**
* String => Name of the designated "identifier" column of a typed table.
*/
final val SELF_REFERENCING_COL_NAME = "SELF_REFERENCING_COL_NAME"
/**
* String => Specifies how values in SELF_REFERENCING_COL_NAME are created.
*/
final val REF_GENERATION = "REF_GENERATION"
}