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

CSV Example README Tutorial Doesn't Work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0.0-incubating
    • None
    • None

    Description

      While kicking the tires I encountered the following failure:

      0: jdbc:calcite:model=target/test-classes/mod> !connect jdbc:calcite:model=target/test-classes/smart.json admin admin
      1: jdbc:calcite:model=target/test-classes/sma> EXPLAIN PLAN FOR SELECT * FROM emps;
      +------+
      | PLAN |
      +------+
      | CsvTableScan(table=[[SALES, EMPS]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]])
       |
      +------+
      1 row selected (0.342 seconds)
      1: jdbc:calcite:model=target/test-classes/sma> SELECT depts.name, count(*)
      . . . . . . . . . . . . . . . . . . . . . . .> FROM emps JOIN depts USING (deptno)
      . . . . . . . . . . . . . . . . . . . . . . .> GROUP BY depts.name;
      Nov 19, 2014 10:45:14 PM org.apache.calcite.sql.validate.SqlValidatorException <init>
      SEVERE: org.apache.calcite.sql.validate.SqlValidatorException: Column 'DEPTNO' matched using NATURAL keyword or USING clause has incompatible types: cannot compare 'JavaType(class java.lang.String)' to 'JavaType(class java.lang.Integer)'
      Nov 19, 2014 10:45:14 PM org.apache.calcite.runtime.CalciteException <init>
      SEVERE: org.apache.calcite.runtime.CalciteContextException: From line 2, column 29 to line 2, column 34: Column 'DEPTNO' matched using NATURAL keyword or USING clause has incompatible types: cannot compare 'JavaType(class java.lang.String)' to 'JavaType(class java.lang.Integer)'
      Error: while executing SQL: SELECT depts.name, count(*)
      FROM emps JOIN depts USING (deptno)
      GROUP BY depts.name (state=,code=0)
      

      Given a pointer to what needs to be addressed, I can try and provide a patch for this.

      Attachments

        1. CALCITE-470-3.patch
          0.9 kB
          Larry McCay
        2. EMPS.csv.gz
          0.3 kB
          Larry McCay
        3. CALCITE-470-2.patch
          0.6 kB
          Larry McCay
        4. OPTIQ-470.patch
          0.4 kB
          Larry McCay

        Activity

          People

            vladimirsitnikov Vladimir Sitnikov
            lmccay Larry McCay
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: