Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data file without suffix can't be read correctly #5301

Closed
RTEnzyme opened this issue Feb 16, 2023 · 2 comments
Closed

data file without suffix can't be read correctly #5301

RTEnzyme opened this issue Feb 16, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@RTEnzyme
Copy link
Contributor

Describe the bug
My data files in linux don't have ".csv" suffix. When I use ctx.read_csv("path/to/csv"), It read blank data rather than the data in my files or an error.

To Reproduce
Use the case in the example csv_sql.rs. I remove the csv file's suffix and cpy /path/to/aggregate_test_100.csv /path/to/aggregate_test_100.

  // register csv file with the execution context
  ctx.register_csv(
      "aggregate_test_100",
      &format!("{testdata}/csv/aggregate_test_100"),
      CsvReadOptions::new(),
  )
  .await?;
 // execute the query
    let df = ctx
        .sql(
            "SELECT c1, MIN(c12), MAX(c12) \
        FROM aggregate_test_100 \
        WHERE c11 > 0.1 AND c11 < 0.9 \
        GROUP BY c1",
        )
        .await?;

    // print the results
    df.show().await?;

The result:

Error: SchemaError(FieldNotFound { field: Column { relation: None, name: "c11" }, valid_fields: [] })

Expected behavior
I think that either the file can be read correctly in this case, or an error that the file suffix does not match will be reported.

Additional context
Add any other context about the problem here.

@RTEnzyme RTEnzyme added the bug Something isn't working label Feb 16, 2023
@tustvold
Copy link
Contributor

I think this is a duplicate of #1736

@RTEnzyme
Copy link
Contributor Author

I think this is a duplicate of #1736

Emm..I think so..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants