RE: Convert RexSubQuery to RexNode

2016-11-30 Thread Anton Mushin
Hi Julian, > RelBuilder does not support TableFunctionScan yet. Can you please log a JIRA > case for that? (And implement it, if you are so inclined.) Do you mean add In RelBuilder TableFunctionScanFactory which will create LogicalTableFunctionScan like as for LogicalTableScan [1] and factory fo

Re: Convert RexSubQuery to RexNode

2016-11-30 Thread Julian Hyde
Adding a TableFunctionScanFactory would be part of it. But also adding a functionScan method, analogous to the scan method but for table functions. On Wed, Nov 30, 2016 at 12:16 AM, Anton Mushin wrote: > Hi Julian, >> RelBuilder does not support TableFunctionScan yet. Can you please log a JIRA >

RE: Convert RexSubQuery to RexNode

2016-11-30 Thread Nikolay Vasilishin
Thanks for your help, Julian, but I think it's not exactly what I want. I have to use RexNodes while implementing logical plan in Flink engine. I found out that I have to implement Rex- and RelShuttle to convert RelNode to correct RexNode. Since it seems to be more complicated than I thought, I

[jira] [Created] (CALCITE-1515) Support TableFunctionScan

2016-11-30 Thread Anton Mushin (JIRA)
Anton Mushin created CALCITE-1515: - Summary: Support TableFunctionScan Key: CALCITE-1515 URL: https://issues.apache.org/jira/browse/CALCITE-1515 Project: Calcite Issue Type: Bug Affects

RE: Convert RexSubQuery to RexNode

2016-11-30 Thread Anton Mushin
Julian thanks for your reply! I created issue about it, if you have any comments about this question, please write them in issue CALCITE-1515. Best regards, Anton Mushin -Original Message- From: Julian Hyde [mailto:jh...@apache.org] Sent: Wednesday, November 30, 2016 12:31 PM To: dev@ca

[jira] [Created] (CALCITE-1516) Upgrade hydromatic-resource-maven-plugin, and re-work SaffronProperties

2016-11-30 Thread Julian Hyde (JIRA)
Julian Hyde created CALCITE-1516: Summary: Upgrade hydromatic-resource-maven-plugin, and re-work SaffronProperties Key: CALCITE-1516 URL: https://issues.apache.org/jira/browse/CALCITE-1516 Project: Ca

Re: Calicite Spark Adapter - java.lang.AssertionError: Expected: a string containing \"PLAN=SparkToEnumerableConverter

2016-11-30 Thread Dharmendra Chouhan
Hi Again, I saw that spark-calcite has now moved to Spark 1.6, so thought of using it.But still the tests are not running, and give below error java.lang.AssertionError: Expected: a string containing "PLAN=SparkToEnumerableConverter\n  SparkCalc(expr#0..1=[{inputs}], expr#2=[2], expr#3=[<($t0, $

Re: Using Spark engine for processing SQL syntax that cannot be pushed to the source system

2016-11-30 Thread Dharmendra Chouhan
Instead of running from sqlline, I created a sample program to run the program.I added the generated classpath folder into by eclipse project's classpath.But I got a NullPointerExceptionCaused by: java.lang.NullPointerException at org.apache.calcite.interpreter.Interpreter.(Interpreter.java:74)

[jira] [Created] (CALCITE-1517) Calcite use ReduceExpressionsRule make '' to ' '

2016-11-30 Thread Dongming Liu (JIRA)
Dongming Liu created CALCITE-1517: - Summary: Calcite use ReduceExpressionsRule make '' to ' ' Key: CALCITE-1517 URL: https://issues.apache.org/jira/browse/CALCITE-1517 Project: Calcite Issue

INSERT with the JdbcAdapter

2016-11-30 Thread Christian Tzolov
Hi, The insert statement via the JdbcAdapter fails with "rel#78:Subset#1.ENUMERABLE.[]] could not be implemented;" I'm testing SQL inserts using the foodmart dataset and postgresql configured as a backend. Following insert works find on postgresql but fails when run through the jdbc adapter: "I

Re: INSERT with the JdbcAdapter

2016-11-30 Thread Christian Tzolov
A test to reproduce the problem: @Test public void testJdbcAdapterInsert() { CalciteAssert.model(JdbcTest.FOODMART_MODEL) .enable(CalciteAssert.DB == POSTGRESQL) .query("INSERT INTO \"foodmart\".\"expense_fact\"(\n" + " \"store_id\", \"account_id\", \"exp_da

[jira] [Created] (CALCITE-1518) Converting SELECT table.nested.field FROM (...) to RelNode throws ArrayIndexOutOfBoundsException

2016-11-30 Thread George Fraser (JIRA)
George Fraser created CALCITE-1518: -- Summary: Converting SELECT table.nested.field FROM (...) to RelNode throws ArrayIndexOutOfBoundsException Key: CALCITE-1518 URL: https://issues.apache.org/jira/browse/CALCITE-

Re: INSERT with the JdbcAdapter

2016-11-30 Thread Julian Hyde
It’s a missing feature. The JDBC adapter does not currently do DML. Can you please log a JIRA case to track. Julian > On Nov 30, 2016, at 7:56 AM, Christian Tzolov wrote: > > A test to reproduce the problem: > > @Test public void testJdbcAdapterInsert() { > > CalciteAssert.model(JdbcTest.

Re: Convert RexSubQuery to RexNode

2016-11-30 Thread Julian Hyde
Many Thanks for logging the JIRA case. It really helps to channel discussions, when several people are running into the same problem (maybe over several months) but most people on this list are not interested, and have inboxes which are too full. > On Nov 30, 2016, at 1:02 AM, Anton Mushin wro

Re: Rule to expand tha JdbcTableScan expression

2016-11-30 Thread Julian Hyde
In this case, you could probably use a planner rule (RelOptRule). Be sure to use HepPlanner, not VolcanoPlanner. The latter will apply cost and deduce that the original is cheaper. Or you could manually iterate over the tree, using RelNode.getInputs(), RelNode.copy(RelTraitSet, List), and recur

Re: Rule to expand tha JdbcTableScan expression

2016-11-30 Thread jordan.halter...@gmail.com
Which planner are you using? If the rule is being fired, what you may be missing is that the cost of the converted expression is more than the cost of the input expression, resulting in the VolcanoPlanner throwing out the converted expression. You should use the HepPlanner for this. > On Nov 2

Re: RelBuilder API issue using table aliases in join condition

2016-11-30 Thread Jess Balint
thoughts? On Tue, Nov 22, 2016 at 3:41 PM, Jess Balint wrote: > Hi, > > Using the RelBuilder API, I would like to create a join condition using > table aliases. The RelBuilder.field(relationAlias, fieldName) method only > checks the top of the stack. The top of the stack is not yet a join node i

Re: RelBuilder API issue using table aliases in join condition

2016-11-30 Thread Julian Hyde
I think you should subscribe to the mailing list. Maybe there are some replies you have missed. :) > On Nov 30, 2016, at 12:18 PM, Jess Balint wrote: > > thoughts? > > On Tue, Nov 22, 2016 at 3:41 PM, Jess Balint wrote: > >> Hi, >> >> Using the RelBuilder API, I would like to create a join

Re: RelBuilder API issue using table aliases in join condition

2016-11-30 Thread Jess Balint
I am subscribed and have seen nothing. Also can't find anything in the archives other than my original message. :( On Wed, Nov 30, 2016 at 2:23 PM, Julian Hyde wrote: > I think you should subscribe to the mailing list. Maybe there are some > replies you have missed. :) > > > On Nov 30, 2016, at

Re: RelBuilder API issue using table aliases in join condition

2016-11-30 Thread Julian Hyde
Sorry, my mistake (or my email provider’s). I sent this reply on 11/22 and it went into my “sent” folder but it seems not to have made it onto the list. > On Nov 22, 2016, at 7:55 PM, Julian Hyde wrote: > > This looks like a bug. But first try writing > > rb.scan("EMP").as("t0”) > .scan(

Re: Rule to expand tha JdbcTableScan expression

2016-11-30 Thread Christian Tzolov
Thanks, Indeed by playing with (and overriding) the cost of the Jdbc rel nodes i'm managed to expand the trees (in many cases). How can i set the HepPlanner instead of Volcano one? On 30 November 2016 at 20:50, jordan.halter...@gmail.com < jordan.halter...@gmail.com> wrote: > Which planner ar

Re: INSERT with the JdbcAdapter

2016-11-30 Thread Christian Tzolov
Thanks Julian, this is unfortunate as it undermines the idea of having jdbc wrapper in front of HAWQ. I will log Jira tickets. How difficult do you think would be to provide DML support for the JDBC adapter? If i am to take a look at it where should look first? Cheers, Christian On 30 November 2

Re: INSERT with the JdbcAdapter

2016-11-30 Thread Julian Hyde
“Unfortunate” is one word for it. If Calcite were complete it would be considerably more expensive. :) You figured out how to implement OVER, so I’d look in a similar place for DML. Julian > On Nov 30, 2016, at 1:42 PM, Christian Tzolov wrote: > > Thanks Julian, this is unfortunate as it unde

[jira] [Created] (CALCITE-1519) Standardize on "sub-query" rather than "subquery" in class names and comments

2016-11-30 Thread Julian Hyde (JIRA)
Julian Hyde created CALCITE-1519: Summary: Standardize on "sub-query" rather than "subquery" in class names and comments Key: CALCITE-1519 URL: https://issues.apache.org/jira/browse/CALCITE-1519 Proje

[jira] [Created] (CALCITE-1520) org.apache.calcite.avatica.AvaticaConnection: support isValid()

2016-11-30 Thread Ningli Fang (JIRA)
Ningli Fang created CALCITE-1520: Summary: org.apache.calcite.avatica.AvaticaConnection: support isValid() Key: CALCITE-1520 URL: https://issues.apache.org/jira/browse/CALCITE-1520 Project: Calcite

[jira] [Created] (CALCITE-1521) In Apache Calcite CSV Adaptor is not Providing Column Metadata

2016-11-30 Thread Prasad V S (JIRA)
Prasad V S created CALCITE-1521: --- Summary: In Apache Calcite CSV Adaptor is not Providing Column Metadata Key: CALCITE-1521 URL: https://issues.apache.org/jira/browse/CALCITE-1521 Project: Calcite