Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4181

Avatica throws exception when select field is a List<Object>

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: avatica-1.17.0
    • Fix Version/s: avatica-1.18.0
    • Component/s: avatica
    • Labels:
      None

      Description

      Currently Calcite supports array columns from both ArrayImpl or List input.

      It also supports both struct and plain java object data format.

      The issue is that an exception is thrown when data is a list of plain java objects, while it works fine when data is a list of struct or an array of plain java objects.

      I have created unit tests to demonstrate the bug.

      Currently these unit tests pass: arraysOfStructs(), listOfStructs(), arrayOfJavaObjects() but listOfJavaObject() is failed.

      Method org.apache.calcite.avatica.util.AbstractCursor.ArrayAccessor.convertValue() misses a case for Types.OTHER, which is for general java objects, hence the exception is thrown.

      The pull request adds that missing type and makes all four unit tests pass.

      Reference link: https://github.com/apache/calcite-avatica/blob/master/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L1346

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kent.nguyen Kent Nguyen
                Reporter:
                kent.nguyen Kent Nguyen
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2.5h
                  2.5h