Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-22884

Select view columns fail when store metadata with hive

    XMLWordPrintableJSON

Details

    Description

      I am use hive for filnk metadata, so select view table will mismatch to hive table after create view, I founded is a bug in HiveCatalog.classs, all view table is default mark to hive table unexpected.

      after store in hive metadata, view table without "is_generic" or "connector" properties.

      bug is here:

      @VisibleForTesting
      public Table getHiveTable(ObjectPath tablePath) throws TableNotExistException {
      try {
      Table table = this.client.getTable(tablePath.getDatabaseName(), tablePath.getObjectName());
      boolean isHiveTable;
      if (table.getParameters().containsKey("is_generic"))

      { isHiveTable = !Boolean.parseBoolean((String)table.getParameters().remove("is_generic")); }

      else

      { isHiveTable = !table.getParameters().containsKey("flink." + FactoryUtil.CONNECTOR.key()) && !table.getParameters().containsKey("flink.connector.type"); }

      if (isHiveTable)

      { table.getParameters().put(FactoryUtil.CONNECTOR.key(), "hive"); }

      return table;
      } catch (NoSuchObjectException var4)

      { throw new TableNotExistException(this.getName(), tablePath); }

      catch (TException var5)

      { throw new CatalogException(String.format("Failed to get table %s from Hive metastore", tablePath.getFullName()), var5); }

      }

      Attachments

        Issue Links

          Activity

            People

              lirui Rui Li
              ELLEX_SHEN ELLEX_SHEN
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: