Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-4549

JDBC compliance change TABLE_SCHEMA to TABLE_SCHEM

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 0.10.0
    • 0.12.0
    • JDBC
    • Hive 0.10

    Description

      The ResultSet returned by HiveDatabaseMetadata.getTables has the metadata columns TABLE_CAT, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, REMARKS. The second column name is not compliant with the JDBC standard (http://docs.oracle.com/javase/6/docs/api/java/sql/DatabaseMetaData.html#getSchemas()): the column name should be TABLE_SCHEM instead of TABLE_SCHEMA.

      Suggested fix in Hive (org.apache.hive.service.cli.operation.GetTablesOperation.java) change from

      private static final TableSchema RESULT_SET_SCHEMA = new TableSchema()
      .addStringColumn("TABLE_CAT", "Catalog name. NULL if not applicable.")
      .addStringColumn("TABLE_SCHEMA", "Schema name.")
      .addStringColumn("TABLE_NAME", "Table name.")
      .addStringColumn("TABLE_TYPE", "The table type, e.g. \"TABLE\", \"VIEW\", etc.")
      .addStringColumn("REMARKS", "Comments about the table.");

      to

      private static final TableSchema RESULT_SET_SCHEMA = new TableSchema()
      .addStringColumn("TABLE_CAT", "Catalog name. NULL if not applicable.")
      .addStringColumn("TABLE_SCHEM", "Schema name.")
      .addStringColumn("TABLE_NAME", "Table name.")
      .addStringColumn("TABLE_TYPE", "The table type, e.g. \"TABLE\", \"VIEW\", etc.")
      .addStringColumn("REMARKS", "Comments about the table.");

      Attachments

        1. HIVE-4549-1.patch
          3 kB
          Prasad Suresh Mujumdar

        Activity

          People

            prasadm Prasad Suresh Mujumdar
            johndee Johndee Burks
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: