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

Incorrect order of columns returned from DatabaseMetaData.getSchemas()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.10.0
    • None
    • Client - JDBC, Metadata
    • 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

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

            Dates

              Created:
              Updated: