Re:re:applying the wrong rule for calculated columns

2022-03-13 Thread xiaobo
uld check fields data, if they are not correct, then should not call call.transformTo. test1_2 now passes. --Original-- From: &quo

re:applying the wrong rule for calculated columns

2022-03-13 Thread xiaobo
after we change the String[] fields to Integer[] fields , the problem still occurs. our runnable test is at https://github.com/guxiaobo/calcite-json-adapter/blob/main/src/test/java/org/apache/calcite/adapter/json/test/JsonSchemaTest.java --- @Test public void

re:applying the wrong rule for calculated columns

2022-03-13 Thread xiaobo
our runnable test is at https://github.com/guxiaobo/calcite-json-adapter/blob/main/src/test/java/org/apache/calcite/adapter/json/test/JsonSchemaTest.java --original mail-- @Test public void test1_2()throws SQLException{ Map map

applying the wrong rule for calculated columns

2022-03-13 Thread xiaobo
@Test public void test1_2()throws SQLException{ Map

Re:Re:column data type mismatch problem when projecting tables

2022-03-13 Thread xiaobo
we updated our enumerator to return only the column data object for single column projects, our projectable adapter works for basic queries now, but faced with new problems which I'll send another mail. Original From:"xiaobo "< guxiaobo1...@qq.com ; Date:2022/3/13 2

Re:column data type mismatch problem when projecting tables

2022-03-13 Thread xiaobo
if we change the sql to "select c1, c2 from js.t1", then test2 passes, and we found that the deduce method CursorFactory returns OBJECT when the resultset has only one column, public static CursorFactory deduce(Listhttps://github.com/masayuki038/calcite-avro-sample, we make a projectable

column data type mismatch problem when projecting tables

2022-03-13 Thread xiaobo
Hi, Followed the avro example at https://github.com/masayuki038/calcite-avro-sample, we make a projectable version of our JsonAdapter at https://github.com/guxiaobo/calcite-json-adapter, but the simple test2 method at

Can't find java file for ImmutableCsvProjectTableScanRule

2022-03-13 Thread xiaobo
Hi, we are trying to make our adapter projectable now, but we can't find the Java file for the ImmutableCsvProjectTableScanRule class in the CSV example, can you help with this. /** Rule configuration. */ @Value.Immutable(singleton = false) public interface Config extends RelRule.Config {

Re: [jira] [Created] (CALCITE-5028) org.codehaus.commons.compiler.CompilerFactoryFactory.getDefaultCompilerFactory(Ljava/lang/ClassLoader;)

2022-03-02 Thread xiaobo
We are sorry that we can't simulate this problem with test code, but the exception really repeats everytime with janino 3.1.6. -- Original -- From: "XiaoboGu (Jira)";; Send time: Wednesday, Mar 2, 2022 7:24 PM To: "dev"; Subject: [jira] [Created]

Re: calcite multi-threading problem

2022-02-25 Thread xiaobo
us.janino >> janino >> >> >> org.codehaus.janino >> commons-compiler >> >> >> >> >> >> org.apache.calcite >> calcite-file >> 1.29.0 >> >> >> org.codehaus.janino >> janino >> >> >> org.codehaus

Re: calcite multi-threading problem

2022-02-25 Thread xiaobo
I have put the testing code at github https://github.com/guxiaobo/gxb-testing/blob/main/calcite-testing/src/test/java/com/xsmartware/testing/calcite/Test1.java -- Original -- From: "xiaobo ";; Send time: Friday, Feb 25, 2022 9:05 PM To: "dev&q

Re: calcite multi-threading problem

2022-02-25 Thread xiaobo
] at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3924) ~[janino-3.1.4.jar:na] at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2391) ~[janino-3.1.4.jar:na] ... 86 common frames omitted With janino 3.1.4 -- Original -

Re: dynamic reflective schema

2022-02-24 Thread xiaobo
We found the answer, we should pass total milliseconds of the day for SQL Time. -- Original -- From: "xiaobo ";; Send time: Thursday, Feb 24, 2022 8:48 PM To: "dev"; Subject: Re: dynamic reflective schema What we want to do is ma

Re: dynamic reflective schema

2022-02-24 Thread xiaobo
LocalTime for SQL Time. -- Original -- From: "xiaobo ";; Send time: Thursday, Feb 24, 2022 12:26 PM To: "dev"; Subject: Re: dynamic reflective schema our adapter now supports string,boolean,bigdecimal,long,localdate,localdatetime, an

Re: dynamic reflective schema

2022-02-24 Thread xiaobo
DOUBLE) corresponds to Java’s double. SQL’s REAL type corresponds to Java’s float. JDBC method names (e.g. getFloat, getDouble) refer to the Java types. Julian > On Feb 23, 2022, at 10:33 PM, xiaobo wrote: > > When trying to map Java Float Objects to SQL Float, we faild with the &

Re: dynamic reflective schema

2022-02-23 Thread xiaobo
(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) -- Original -- From: "xiaobo ";; Send time

Re: dynamic reflective schema

2022-02-22 Thread xiaobo
we have put the test coding on github https://github.com/guxiaobo/calcite-json-adapter/tree/main/src/test/java/org/apache/calcite/adapter/json/test -- Original -- From: "xiaobo ";; Send time: Wednesday, Feb 23, 2022 3:11 PM To: "dev"; Su

Re: dynamic reflective schema

2022-02-22 Thread xiaobo
ter name for that class than ‘Baz’. :) I figured ‘it’s generated, no one is ever going to know its name’. How wrong I was. The stack traces are all over the internet. Julian > On Feb 22, 2022, at 3:32 PM, Scott Reynolds wrote: > > Whenever I see "at Baz.bind(Unknown Source)

public RelDataType getRowType(RelDataTypeFactory typeFactory) of subclass of AbstractTable does not called

2022-02-22 Thread xiaobo
Hi, we are trying to make a dynamic reflective schema at github: https://github.com/guxiaobo/calcite-json-adapter we found our getRowType method has not been called when creating our JsonSchema nor executing SQL, can you help checking what's missing. below is the main test code:

Re: dynamic reflective schema

2022-02-22 Thread xiaobo
this helps =) On Sat, Feb 19, 2022 at 11:03 PM xiaobo

Re: dynamic reflective schema

2022-02-21 Thread xiaobo
It seems because the public RelDataType getRowType(RelDataTypeFactory typeFactory) method of our JsonTable class did not have a change to be called. -- Original -- From: "xiaobo ";; Send time: Tuesday, Feb 22, 2022 2:57 PM To: "dev"; Su

Re: dynamic reflective schema

2022-02-21 Thread xiaobo
bably want to use "JsonScannableTable" The CsvSchema example does exactly this, if you want to see an example implementation: https://github.com/apache/calcite/blob/4bc916619fd286b2c0cc4d5c653c96a68801d74e/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvSchema.java#L69-L1

dynamic reflective schema

2022-02-19 Thread xiaobo
Hi, When using reflectiveSchema we must define a static Java class for the schema object, but in our use case the actual data to query is dynamic, define JAVA class for each data combination is impossible, we have an idea that can we make a JSONSchema which accepts a Map>, so that each List

Re: can we set a default schema for calcite connection to avoid writing schema names in sql

2022-02-19 Thread xiaobo
ectiveSchema and "select > count(*) from emps"; query execution to help you > Give me one moment please > > On Sat, Feb 19, 2022 at 8:52 AM xiaobo > wrote: > >> Hi, >> >> There is a documented "schema" parameter for the jdbc connect

Re: can we set a default schema for calcite connection to avoid writing schema names in sql

2022-02-19 Thread xiaobo
GavinRay97/GraphQLCalcite/blob/1070d179b67d803f05975cf416c392b010823069/src/main/java/com/example/calcitewrappers/DatabaseManager.java#L22-L60 Hope this is helpful =) On Fri, Feb 18, 2022 at 10:06 AM xiaobo wrote: > Hi Gavin, > > Can you share a complete example of using a FrameworkConfig > o

Re: can we set a default schema for calcite connection to avoid writing schema names in sql

2022-02-18 Thread xiaobo
8348/src/main/kotlin/CalciteSchemaManager.kt#L23-L117 And here is the same in Java: https://github.com/GavinRay97/GraphQLCalcite/blob/1070d179b67d803f05975cf416c392b010823069/src/main/java/com/example/calcitewrappers/DatabaseManager.java#L22-L60 Hope this is helpful =) On Fri, Feb 18, 2022

Re: can we set a default schema for calcite connection to avoid writing schema names in sql

2022-02-18 Thread xiaobo
t#L23-L117 And here is the same in Java: https://github.com/GavinRay97/GraphQLCalcite/blob/1070d179b67d803f05975cf416c392b010823069/src/main/java/com/example/calcitewrappers/DatabaseManager.java#L22-L60 Hope this is helpful =) On Fri, Feb 18, 2022 at 10:06 AM xiaobo wrote: > Hi Gavin, > >

Re: can we set a default schema for calcite connection to avoid writing schema names in sql

2022-02-18 Thread xiaobo
ma, add a ReflectiveSchema, and then set this as the default schema: val rootSchema: SchemaPlus = Frameworks.createRootSchema(true) val hrReflectiveSchema = ReflectiveSchema(HrSchema()) rootSchema.add("hr", hrReflectiveSchema) Frameworks.newConfigBuilder() .defaultSchema(rootSchema.getSubSch

Re: calcite multi-threading problem

2022-02-15 Thread xiaobo
reads. Best, Stamatis On Sat, Feb 12, 2022 at 2:14 PM xiaobo wrote: > 3.1.4 of janino and commons-compiler works now. > > > > > ------ Original -- > From: "xiaobo ";; > Send time: Saturday, Feb 12, 2022 8:04 PM > To: "dev"

Re: can we set a default schema for calcite connection to avoid writing schema names in sql

2022-02-12 Thread xiaobo
t; instead of "emps" val frameworkConfig: FrameworkConfig = Frameworks.newConfigBuilder() .defaultSchema(connection.rootSchema) .parserConfig(SqlParser.config().withCaseSensitive(false)) .build() Hope this helps =) On Fri, Feb 11, 2022 at 9:09 PM xiaobo wrote: > sorry for the html escape char

Re: calcite multi-threading problem

2022-02-12 Thread xiaobo
3.1.4 of janino and commons-compiler works now. -- Original -- From: "xiaobo ";; Send time: Saturday, Feb 12, 2022 8:04 PM To: "dev"; Subject: Re: calcite multi-threading problem but strange enough, the same code work

Re: calcite multi-threading problem

2022-02-12 Thread xiaobo
but strange enough, the same code works in a single thread. -- Original -- From: "xiaobo ";; Send time: Saturday, Feb 12, 2022 8:02 PM To: "dev"; Subject: Re: calcite multi-threading problem we checked the janino release not

Re: calcite multi-threading problem

2022-02-12 Thread xiaobo
y method with a classloader parameter was removed intentionally? but it seems calcite still needs it , so what version of janino should we use for the latest calcite-core? ------ Original -- From: "xiaobo ";; Send time: Saturday, Feb 12, 2022 12:01 PM T

Re: Unable to implement EnumerableAggregate(group=[{}], EXPR$0=[COUNT($0)]) with ReflectiveSchema

2022-02-11 Thread xiaobo
We come to the conclusion that fileds for tables and columns of the target class must be public, and those not for tables and columns must not be public, are we right? -- Original -- From: "xiaobo ";; Send time: Saturday, Feb 12, 2022 9:57 A

Re: calcite multi-threading problem

2022-02-11 Thread xiaobo
[] { new URL("jar:file:" + path + "!/") }, getClass().getClassLoader()); Class clazz = Class.forName(classPath, true, loader); we mention this because the error message shows a classloader parameter. -- Original -----

Re: calcite multi-threading problem

2022-02-11 Thread xiaobo
And if we remove calcite from our project, janino is not in "resolved depencies" library list of pom.xml, So we think it not the janino conflic problem. -- Original -- From: "xiaobo ";; Send time: Saturday, Feb 12, 2022 9:49 AM To: &

Re: can we set a default schema for calcite connection to avoid writing schema names in sql

2022-02-11 Thread xiaobo
unwrap(CalciteConnection.class); SchemaPlus rootSchema = conn.getRootSchema(); Schema schema = new ReflectiveSchema(target); rootSchema.add(schemaName, schema); return conn; -- Original -- From: &qu

Unable to implement EnumerableAggregate(group=[{}], EXPR$0=[COUNT($0)]) with ReflectiveSchema

2022-02-11 Thread xiaobo
Simple count sql against ReflectiveSchema failed with : Error while executing SQL "select count(a.PA01AI01) from p.PRH_PA01 as a ": Unable to implement EnumerableAggregate(group=[{}], EXPR$0=[COUNT($0)]): rowcount = 10.0, cumulative cost = {111.25 rows, 101.0 cpu, 0.0 io}, id = 37

Re: 回复:cannot be cast to class org.apache.calcite.runtime.FlatLists$ComparableList error

2022-02-11 Thread xiaobo
Sorry for the HTML escape characters, I rewrite the problem as following: SQL select count(a.PA01AI01) from p.PRH_PA01 as a failed with : Caused by: java.sql.SQLException: Error while executing SQL "select count(a.PA01AI01) from p.PRH_PA01 as a ": From line 1, column 16 to line 1, column 23:

Re: calcite multi-threading problem

2022-02-11 Thread xiaobo
can you share the solution for the problem, we are using the following libraries, and it seems janino 3.1.6 is only dependent by calcite-core. UTF-8 UTF-8 9 9 9 2.17.1 7.64.0.Final org.apache.calcite

Re: calcite multi-threading problem

2022-02-11 Thread xiaobo
sorry about that, I'll correct it. -- Original -- From: "Julian Hyde";; Send time: Saturday, Feb 12, 2022 9:41 AM To: "dev"; Subject: Re: calcite multi-threading problem xiaobo, Your emails are coming through with a lot of HTML

Re: calcite multi-threading problem

2022-02-11 Thread xiaobo
can you share the solution for the problem, we are using the following libraries, and it seems janino 3.1.6 is only dependent by calcite-core.

回复:cannot be cast to class org.apache.calcite.runtime.FlatLists$ComparableList error

2022-02-11 Thread xiaobo
the first filed's java class is as following, and SQL select count(a.PA01AI01) from p.PRH_PA01 as a failed with : Caused by: java.sql.SQLException: Error while executing SQL "select count(a.PA01AI01) from p.PRH_PA01 as a ": From line 1, column 16 to line 1, column 23: Column 'PA01AI01'

can we set a default schema for calcite connection to avoid writing schema names in sql

2022-02-11 Thread xiaobo
we have tried the following and it does not work Class.forName("org.apache.calcite.jdbc.Driver"); Properties info = new Properties(); info.setProperty("lex", "JAVA"); info.setProperty(CalciteConnectionProperty.CASE_SENSITIVE.camelName(), "false");

回复:reply: calcite multi-threading problem

2022-02-11 Thread xiaobo
: "xiaobo "

reply: calcite multi-threading problem

2022-02-11 Thread xiaobo
we use maven and the effective pom contains only the 3.1.0 version of janino as following:

Re: calcite multi-threading problem

2022-02-11 Thread xiaobo
yes, we use drools in the same project, and drools uses janino too, is there a version list of janino which calcite supports? ---Original--- From: "Dmitry Sysolyatin"

Re: calcite multi-threading problem

2022-02-11 Thread xiaobo
yes, we use drools in the same project, and drools uses janino too, is there a version list of janino which janino supports? ---Original--- From: "Dmitry Sysolyatin"

calcite multi-threading problem

2022-02-11 Thread xiaobo
Hi, we open a calcite connection with ReflectiveSchema in one thread, and execute sqls in other threads against the connection, but failed with this error com.google.common.util.concurrent.ExecutionError: java.lang.NoSuchMethodError:

cannot be cast to class org.apache.calcite.runtime.FlatLists$ComparableList error

2022-02-11 Thread xiaobo
Hi, Our testing code failed with the following error, can you help with it: Error while executing SQL "select count(1) from p.PRH_PA01 ": class com.xsmartware.pbcm.sdk.pbc2p.PRH_PA01 cannot be cast to class org.apache.calcite.runtime.FlatLists$ComparableList

[jira] [Created] (CALCITE-2950) Avatica DriverVersion.load leaks InputStream

2019-03-24 Thread Xiaobo Liao (JIRA)
Xiaobo Liao created CALCITE-2950: Summary: Avatica DriverVersion.load leaks InputStream Key: CALCITE-2950 URL: https://issues.apache.org/jira/browse/CALCITE-2950 Project: Calcite Issue Type