You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by sn...@apache.org on 2025/01/13 21:03:43 UTC

(flink-connector-hive) 13/22: [FLINK-35188][table-api] Introduce CatalogMaterializedTable interface to support materialized table

This is an automated email from the ASF dual-hosted git repository.

snuyanzin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-connector-hive.git

commit b5d928a6fa159b1bd1605d0edd3fb495bfd31e9c
Author: fengli <ld...@163.com>
AuthorDate: Tue Apr 23 10:01:31 2024 +0800

    [FLINK-35188][table-api] Introduce CatalogMaterializedTable interface to support materialized table
---
 .../table/endpoint/hive/util/OperationExecutorFactory.java   | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/flink-connector-hive/src/main/java/org/apache/flink/table/endpoint/hive/util/OperationExecutorFactory.java b/flink-connector-hive/src/main/java/org/apache/flink/table/endpoint/hive/util/OperationExecutorFactory.java
index d3d31f39..ecaba8a5 100644
--- a/flink-connector-hive/src/main/java/org/apache/flink/table/endpoint/hive/util/OperationExecutorFactory.java
+++ b/flink-connector-hive/src/main/java/org/apache/flink/table/endpoint/hive/util/OperationExecutorFactory.java
@@ -101,6 +101,10 @@ import static org.apache.hadoop.hive.serde2.thrift.Type.VARCHAR_TYPE;
 /** Factory to create the operation executor. */
 public class OperationExecutorFactory {
 
+    // Hive dialect doesn't support materialized table currently.
+    private static final Set<TableKind> TABLE_KINDS =
+            new HashSet<>(Arrays.asList(TableKind.TABLE, TableKind.VIEW));
+
     public static Callable<ResultSet> createGetCatalogsExecutor(
             SqlGatewayService service, SessionHandle sessionHandle) {
         return () -> executeGetCatalogs(service, sessionHandle);
@@ -291,14 +295,13 @@ public class OperationExecutorFactory {
         Set<String> schemaNames =
                 filterAndSort(
                         service.listDatabases(sessionHandle, specifiedCatalogName), schemaName);
-        Set<TableKind> tableKinds = new HashSet<>(Arrays.asList(TableKind.values()));
 
         List<RowData> results = new ArrayList<>();
         for (String schema : schemaNames) {
             Set<TableInfo> tableInfos =
                     filterAndSort(
                             service.listTables(
-                                    sessionHandle, specifiedCatalogName, schema, tableKinds),
+                                    sessionHandle, specifiedCatalogName, schema, TABLE_KINDS),
                             candidates -> candidates.getIdentifier().getObjectName(),
                             tableName);
 
@@ -369,10 +372,7 @@ public class OperationExecutorFactory {
             Set<TableInfo> tableInfos =
                     filterAndSort(
                             service.listTables(
-                                    sessionHandle,
-                                    specifiedCatalogName,
-                                    schema,
-                                    new HashSet<>(Arrays.asList(TableKind.values()))),
+                                    sessionHandle, specifiedCatalogName, schema, TABLE_KINDS),
                             candidate -> candidate.getIdentifier().getObjectName(),
                             tableName);