Julian,

Thanks for confirming, I'm sure I must be breaking something somewhere.


On 2016-09-15 06:06 PM, Julian Hyde wrote:
Surprised this doesn't work. It works for me:

$ ./sqlline
sqlline> !connect
jdbc:calcite:model=example/csv/src/test/resources/model.json sa ""
0: jdbc:calcite:model=example/csv/src/test/re> select empno from
sales.emps order by deptno;
+-------+
| EMPNO |
+-------+
| 100   |
| 110   |
| 120   |
| 110   |
| 130   |
+-------+
5 rows selected (0.252 seconds)
0: jdbc:calcite:model=example/csv/src/test/re>

Julian


On Thu, Sep 15, 2016 at 6:02 PM, Homer <[email protected]> wrote:
Hi,

I'm having an issue validating a query (using Calcite 1.8)  with an order by
statement that doesn't reference columns in the select clause.  I'm sure the
issue is mine in the meta processing but just wanted to confirm Calcite
should support it.

Simplified example

create table test1 (field1 text, field2 text);

select field1,field2 from test1 order by field2;    ---- this works fine

select field1 from test1 order by field2;   ---- this errors with a message
like "org.apache.calcite.sql.validate.SqlValidatorException: Column 'field2'
not found in any table"

Should this syntax be valid in Calcite?

thanks



Reply via email to