Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-6290

[Rust] [DataFusion] sql_csv example errors when running

Details

    Description

      The current version of https://github.com/apache/arrow/blob/master/rust/datafusion/examples/csv_sql.rs errors when running it.

      thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ExecutionError("Cannot compare Float32 with Float64")', src/libcore/result.rs:1084:5

      I believe that this is due to column c11 being declared as DataType::Float32 while the WHERE clause parses the numbers as DataType::Float64. Since the comparison_ops only matches when the parsed data types for left and right are the same, this errors out.

      I was able to get this running locally through either of the following two methods:

      (1) by changing the schema for c11 to be a DataType::Float64.

      (2) by forcing a compute::cast in the case that the left data type is different from the right data type in the BinaryExpr (this is likely not the best long-term fix, but it works for this case).

      It is also possible that this issue could be due to some mistake or incorrect assumption I am making when running it on my end (I am pretty new to the project).

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              andyscho Andrew Schoenberger
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 20m
                  20m

                  Slack

                    Issue deployment