Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5836

Incorrect order of columns returned from DatabaseMetaData.getSchemas()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.10.0
    • Fix Version/s: None
    • Component/s: Client - JDBC, Metadata
    • Labels:
      None

      Description

      DatabaseMetaData.getSchemas() of a Drill JDBC connection returns ResultSet with columns (TABLE_CATALOG, TABLE_SCHEM) instead of (TABLE_SCHEM, TABLE_CATALOG).
      Please refer to http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getSchemas() for details.

      The potential root cause is that org.apache.drill.jdbc.impl.DrillMetaImpl.drillFieldMetaData(Class<?> clazz) relies on the order of the fields of clazz.
      In this case, clazz is oadd.org.apache.calcite.avatica.MetaImpl.MetaSchema but its fields tableCatalog comes first and tableSchem.
      As a result, (TABLE_CATALOG, TABLE_SCHEM) is returned.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              second88 second88
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: