You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Ruihang Xia (Jira)" <ji...@apache.org> on 2020/11/13 05:18:00 UTC

[jira] [Commented] (ARROW-9911) [Rust][DataFusion] SELECT with no FROM clause should produce a single row of output

    [ https://issues.apache.org/jira/browse/ARROW-9911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17231166#comment-17231166 ] 

Ruihang Xia commented on ARROW-9911:
------------------------------------

Hi, AFAIK DataFusion accept this query and generates an `EmptyExec` in the physical plan for "empty relation". And this `EmptyExec` is expected to produce no rows, which is corresponding to the current output. This might be a new feature but not a bug.

If we want to get some rows from queries like this, I think either the behavior of `EmptyExec` needs to be changed or add a new `ExecutionPlan` impl needs to be added to support these kinds of queries.

Also, I think other queries like "select 1 + 2" and "select 1, 2.2" are the same. Thus executing expression and different data types may need to be taken into consideration either.

I'm willing to help with this, but not very sure where to start. Any suggestions or discussion is appreciated. Regards.

> [Rust][DataFusion] SELECT <expression> with no FROM clause should produce a single row of output
> ------------------------------------------------------------------------------------------------
>
>                 Key: ARROW-9911
>                 URL: https://issues.apache.org/jira/browse/ARROW-9911
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Rust, Rust - DataFusion
>            Reporter: Andrew Lamb
>            Priority: Minor
>              Labels: beginner
>
> This is somewhat of a special case, but it is useful for demonstration / testing expressions. 
> A select expression with no where clause, such as "select 1" should produce a single row. Today datafusion accepts the query but produces no rows.
> Actual output:
> {code}
> arrow/rust$ cargo run --release  --bin datafusion-cli 
>     Finished release [optimized] target(s) in 0.25s
>      Running `target/release/datafusion-cli`
> > select 1 ;
> 0 rows in set. Query took 0 seconds.
> {code}
> Expected output is a single row, with the value 1. Here is an example using SQLLite :
> {code}
> $ sqlite3 
> SQLite version 3.28.0 2019-04-15 14:49:49
> Enter ".help" for usage hints.
> Connected to a transient in-memory database.
> Use ".open FILENAME" to reopen on a persistent database.
> sqlite> select 1;
> 1
> sqlite> 
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)