Re: ElasticSearch. Explicit Definitions, Literals and RelBuilder

2018-05-17 Thread Andrei Sereda
;> 3) Whenever you want to see how to build a particular query, you may find >> it helpful to run "EXPLAIN PLAN FOR " in sqlline. >> >> -- >> Michael Mior >> mm...@uwaterloo.ca >> >> >> Le jeu. 17 mai 2018 à 01:26, Andrei Sereda <and...@

Re: ElasticSearch. Explicit Definitions, Literals and RelBuilder

2018-05-17 Thread Andrei Sereda
myself unfortunately. I think > for your ???, you want builder.field(0) although builder.field("_MAP") may > also work. > > -- > Michael Mior > mm...@uwaterloo.ca > > > Le jeu. 17 mai 2018 à 10:39, Andrei Sereda <and...@sereda.cc> a écrit : >

Re: ElasticSearch. Explicit Definitions, Literals and RelBuilder

2018-05-17 Thread Andrei Sereda
> > > Mit freundlichen Grüßen, > > *Christian Beikov* > Am 17.05.2018 um 17:43 schrieb Andrei Sereda: > >> Regarding (2) Lower-case problem. The issue seems to be in >> ElasticsearchFilter.Translator >> <

Re: ElasticSearch use of rest client (instead of TransportClient)

2018-05-18 Thread Andrei Sereda
> > Mit freundlichen Grüßen, > > *Christian Beikov* > Am 18.05.2018 um 21:19 schrieb Andrei Sereda: > > Yes it should be, since it is just an http client (apache http). > > ElasticSearch Rest API (query API) didn't change much > > < > https://www.elastic

Re: ElasticSearch use of rest client (instead of TransportClient)

2018-05-18 Thread Andrei Sereda
> > Mit freundlichen Grüßen, > > *Christian Beikov* > Am 18.05.2018 um 20:45 schrieb Andrei Sereda: > >> Hello, >> >> ES TransportClient is deprecated in 7.0 (to be removed >> <https://www.elastic.co/guide/en/e

ElasticSearch use of rest client (instead of TransportClient)

2018-05-18 Thread Andrei Sereda
Hello, ES TransportClient is deprecated in 7.0 (to be removed in 8.0) in favor of http rest client(s). Would you consider a contribution switching to Rest Low-Level Client

ElasticSearch Adapters. Calcite vs Dremio

2018-05-16 Thread Andrei Sereda
Hello, I've noticed that Dremio implemented their own (calcite) adapters for ElasticSearch. According to documentation those adapters support ES

ElasticSearch. Explicit Definitions, Literals and RelBuilder

2018-05-16 Thread Andrei Sereda
Hello Calcite Devs, I have some questions about ES adapter and custom predicates / projections in Calcite. Your help is much appreciated. 1) All ES examples use a view (ZIPS ) which

Re: Elasticsearch integration test failures

2018-06-07 Thread Andrei Sereda
Hi Volodymyr, We're trying to bridge the gap between unit and integration tests (which are run infrequently) using fakes in Calcite. Currently the plan is to use fongo (see CALCITE-2345 for mongo adapter) and local elastic node (see

Re: Elasticsearch integration test failures

2018-06-18 Thread Andrei Sereda
ticsearch5Table you add the rules to the ElasticsearchTableScan > constructor. > > > Mit freundlichen Grüßen, > > *Christian Beikov* > Am 13.06.2018 um 06:15 schrieb Andrei Sereda: > > The issue seems to have start

Re: [2/2] calcite git commit: [CALCITE-2345] Running Unit tests with Fongo and integration tests with real mongo instance (Andrei Sereda)

2018-06-14 Thread Andrei Sereda
fix ASAP. > > > > > > > On Jun 13, 2018, at 6:00 PM, mm...@apache.org wrote: > > > > > > [CALCITE-2345] Running Unit tests with Fongo and integration tests with > > real mongo instance (Andrei Sereda) > > > > > > Better test coverage for

Re: Elasticsearch integration test failures

2018-06-11 Thread Andrei Sereda
...@gmail.com> wrote: > For me that's fine, though it would be great if you could fix those given > your time permits it. > > Andrei Sereda schrieb am Mo., 11. Juni 2018, 22:12: > > > There are some tests which have been failing for while. Is it OK if I > > temporary ma

Re: Elasticsearch integration test failures

2018-06-11 Thread Andrei Sereda
hat PR given that Travis CI reports no test failures. > > > Mit freundlichen Grüßen, > > *Christian Beikov* > Am 11.06.2018 um 14:33 schrieb Andrei Sereda: > >> Do the tests succeed with the l

Re: Elasticsearch integration test failures

2018-06-11 Thread Andrei Sereda
o I'm all in on using just a > > local node which is also something I wanted to do for a long time, but > > you got to it before I did. > > > > Do the tests succeed with the local node? > > > > > > Mit freundlichen Grüßen, > > --

Re: Elasticsearch integration test failures

2018-06-11 Thread Andrei Sereda
Michael Mior > mm...@apache.org > > > Le lun. 11 juin 2018 à 08:34, Andrei Sereda a écrit : > > > > Do the tests succeed with the local node? > > IT tests haven't been migrated to local node yet. I wanted to do it as > > separate commit. > > There are new

Re: Elasticsearch integration test failures

2018-06-11 Thread Andrei Sereda
For mongo / fongo <https://github.com/fakemongo/fongo> unfortunately we still have to run IT tests because fongo doesn't support all functionalies (see issue #152 <https://github.com/fakemongo/fongo/issues/152> as example). On Mon, Jun 11, 2018 at 10:26 AM, Andrei Sereda wrote: &

Re: using "fakes" in unit tests

2018-05-30 Thread Andrei Sereda
adapters is great > in my books. > > -- > Michael Mior > mm...@apache.org > > > > Le lun. 28 mai 2018 à 23:47, Andrei Sereda a écrit : > > > Hello, > > > > Current IT tests require manual startup and seeding of data-sources > (Mongo, > > ES,

RxNode (Filter) / Translator for various adapters (ES, Mongo, Geode etc.). Possible Bug ?

2018-05-28 Thread Andrei Sereda
Hello, Please correct me if my expectations are inaccurate about query predicates in Calcite. I think there is an issue in how expression translators work when AST is more complex (has more depth). Same code / logic is used across different adapters (Mongo / Geode / ES) so multiple data-sources

skipping JDBC API (or ResultSet metadata / pagination)

2018-05-28 Thread Andrei Sereda
Hello, Is there a way to get Enumerator directly from RelNode bypassing JDBC calls like createStatement() / executeQuery() ? I'm looking for something like this: RelBuilder builder = . RelNode filter = builder.scan("mySchema", "myTable").filter().build(); Enumerable result =

Re: RxNode (Filter) / Translator for various adapters (ES, Mongo, Geode etc.). Possible Bug ?

2018-05-28 Thread Andrei Sereda
; method to add to MongoAdapterIT) even better. > > On Mon, May 28, 2018 at 2:47 PM, Andrei Sereda wrote: > > Hello, > > > > Please correct me if my expectations are inaccurate about query > predicates > > in Calcite. > > > > I think there is an issue in

using "fakes" in unit tests

2018-05-28 Thread Andrei Sereda
Hello, Current IT tests require manual startup and seeding of data-sources (Mongo, ES, Geode etc.) from separate git project (see calcite-test-dataset ). While useful they force developer to bootstrap additional environment on his own and don't work

Re: RxNode (Filter) / Translator for various adapters (ES, Mongo, Geode etc.). Possible Bug ?

2018-05-29 Thread Andrei Sereda
/core/src/main/java/org/apache/calcite/rex/RexVisitor.java> is not being used to (recursively) translate RelNode into mongo query ? Would like to take a stub at CALCITE-2331 but, before, want to ensure I'm not missing anything. On Tue, May 29, 2018 at 7:20 AM, Andrei Sereda wrote: > Any rea

Re: RxNode (Filter) / Translator for various adapters (ES, Mongo, Geode etc.). Possible Bug ?

2018-05-29 Thread Andrei Sereda
order of conditions (eg. first AND then OR) which is not generic enough. Is it for operator precedence ? On Mon, May 28, 2018 at 11:20 PM, Andrei Sereda wrote: > Yes seems like subtree is not visited recursively for OR opeator(s). > > I have added a test to track this issue: htt

Re: using "fakes" in unit tests

2018-05-31 Thread Andrei Sereda
alcite-test-dataset artifacts need to be available in maven central. Also, for unit tests, I would suggest to add a smaller set (eg ~10-50 records called zips-mini.json) compared to existing 30k records in zips.json ? Let me know what you think. On Thu, May 31, 2018 at 10:27 AM, Andrei Sereda

Re: using "fakes" in unit tests

2018-05-31 Thread Andrei Sereda
Michael Mior > mm...@uwaterloo.ca > > > Le jeu. 31 mai 2018 à 00:53, Andrei Sereda a écrit : > > > Pls take a look at PR 715 <https://github.com/apache/calcite/pull/715> > and > > let me know what you think. > > > > I'm not sure if one should reuse

Re: Elasticsearch Adapter. Removal of Mapping Types (by vendor). Index == Table

2018-06-29 Thread Andrei Sereda
index is given, the we only discover types according to the > > "type_field" configuration and the default for "table_mapping" is > > "type" > > > > This would also allow to discover indexes but still use "type" as > > &quo

Re: Elasticsearch Adapter. Removal of Mapping Types (by vendor). Index == Table

2018-06-29 Thread Andrei Sereda
Plus allow to filter indexes using regexp ? On Fri, Jun 29, 2018 at 1:58 PM Andrei Sereda wrote: > I agree there should be a configuration option. How about the following > approach. > > Expose both variables ${index} and ${type} in configuration (JSON) and > user will use t

Re: Elasticsearch Adapter. Removal of Mapping Types (by vendor). Index == Table

2018-06-29 Thread Andrei Sereda
" with a type called "y_z". If I write "x_y_z" > it's not clear how it should be broken into index/type. > > > On Fri, Jun 29, 2018 at 3:15 PM, Andrei Sereda wrote: > >> Can you show how those examples affect SQL against the ES adapter and/or > > how t

Re: Elasticsearch Adapter. Removal of Mapping Types (by vendor). Index == Table

2018-06-29 Thread Andrei Sereda
; > > You seem to be using '_' as a separator character. Are we sure that > > people will never use it in index or type name? Separator characters > > often cause problems. > > > > Julian > > > > > > > > > > On Fri, Jun 29, 2018 at 10:

Re: Elasticsearch Adapter. Removal of Mapping Types (by vendor). Index == Table

2018-06-29 Thread Andrei Sereda
stop using the parameter. > > Julian > > > > On Jun 29, 2018, at 4:43 PM, Andrei Sereda wrote: > > > > That's a valid point. Then user would define a different pattern like > > "i$index_t$type" for his cluster. > > > > I think we shoul

Re: [2/2] calcite git commit: [CALCITE-2347] running ElasticSearch in embedded mode for unit tests of ES adapter (Andrei Sereda)

2018-06-27 Thread Andrei Sereda
juin 2018 à 20:17, Julian Hyde a écrit : > > > I’m reviewing and testing just the package-exclusion part now. Hopefully > > will commit shortly. > > > > > On Jun 25, 2018, at 2:11 PM, Andrei Sereda wrote: > > > > > > PS. ES2+ES5 changes will be submitted

Re: ElasticSearch use of rest client (instead of TransportClient)

2018-06-27 Thread Andrei Sereda
Beikov* > Am 22.06.2018 um 20:24 schrieb Michael Mior: > > Looks good to me but I'll defer to Christian since I know little about > ES. > > Thanks for this Andrei! > > -- > > Michael Mior > > mm...@apache.org > > > > > > > >

Re: ElasticSearch use of rest client (instead of TransportClient)

2018-06-22 Thread Andrei Sereda
> -- > Michael Mior > mm...@apache.org > > > > Le ven. 22 juin 2018 à 12:37, Andrei Sereda a écrit : > > > Some questions regarding this change: > > > > 1) Should one remove ES2 and ES5 adapters (maven modules) in favor of > > single one: just ES

Re: [2/2] calcite git commit: [CALCITE-2347] running ElasticSearch in embedded mode for unit tests of ES adapter (Andrei Sereda)

2018-06-22 Thread Andrei Sereda
ackage org.elasticsearch.node.internal does not exist > > [ERROR] import org.elasticsearch.node.internal.InternalSettingsPreparer; > > [ERROR] ^ > > [ERROR] > > > >> On Jun 21, 2018, at 3:39 AM, mm...@apache.org wrote: > >> > >> [CALCITE-2347] running Elast

Re: [2/2] calcite git commit: [CALCITE-2347] running ElasticSearch in embedded mode for unit tests of ES adapter (Andrei Sereda)

2018-06-22 Thread Andrei Sereda
s faster) > >>> > >>> Created separate ES JUnit rule which can be re-used across different > >> tests. > >>> > >>> Both v2 and v5 of ES adapters are supported. >

Re: [2/2] calcite git commit: [CALCITE-2347] running ElasticSearch in embedded mode for unit tests of ES adapter (Andrei Sereda)

2018-06-25 Thread Andrei Sereda
t passed on my env. > > > > I think it should be also checked with other JDK versions besides 8. > > > > Kind regards, > > Volodymyr Vysotskyi > > > > > > пн, 25 черв. 2018 о 07:05 Andrei Sereda пише: > > > >> Can you please check the

Re: [2/2] calcite git commit: [CALCITE-2347] running ElasticSearch in embedded mode for unit tests of ES adapter (Andrei Sereda)

2018-06-25 Thread Andrei Sereda
OK. I'm working on it. On Mon, Jun 25, 2018 at 2:18 PM Julian Hyde wrote: > > On Jun 25, 2018, at 11:11 AM, Andrei Sereda wrote: > > > > Would you consider merging this partial javadoc fix (PR 741 > > <https://github.com/apache/calcite/pull/741>) as precursor for

Re: [2/2] calcite git commit: [CALCITE-2347] running ElasticSearch in embedded mode for unit tests of ES adapter (Andrei Sereda)

2018-06-25 Thread Andrei Sereda
ichael. Once implemented, it should automatically fix current classpath issue in javadoc. On Mon, Jun 25, 2018 at 2:23 PM Andrei Sereda wrote: > OK. I'm working on it. > > On Mon, Jun 25, 2018 at 2:18 PM Julian Hyde wrote: > >> > On Jun 25, 2018, at 11:11 AM, Andrei Sereda

Re: [2/2] calcite git commit: [CALCITE-2347] running ElasticSearch in embedded mode for unit tests of ES adapter (Andrei Sereda)

2018-06-25 Thread Andrei Sereda
PS. ES2+ES5 changes will be submitted in a couple of days. On Mon, Jun 25, 2018 at 4:56 PM Andrei Sereda wrote: > Temporary excluded elasticsearch2 package from javadoc. This should > unblock users. > Tested with JDK 8,9 and 10 (maven 3.5.2 / 3.5.4) macOSX > > Please double-chec

Re: ElasticSearch use of rest client (instead of TransportClient)

2018-06-22 Thread Andrei Sereda
t problematic. > > > Mit freundlichen Grüßen, > > *Christian Beikov* > Am 22.06.2018 um 19:07 schrieb Andrei Sereda: > > 1) If we go single (and separate) ES adapter route, people will have to > > change

Re: ElasticSearch use of rest client (instead of TransportClient)

2018-06-22 Thread Andrei Sereda
to create / parse JSON formats, ES adapter would have to depend on some JSON library (most likely existing Jackson). Is that acceptable ? On Fri, May 18, 2018 at 4:29 PM Andrei Sereda wrote: > I believe this shouldn't be an issue with http client (contrary to native > transport) >

Re: [2/2] calcite git commit: [CALCITE-2347] running ElasticSearch in embedded mode for unit tests of ES adapter (Andrei Sereda)

2018-06-24 Thread Andrei Sereda
^ > > > [ERROR] > > > /home/jhyde/open1/calcite.4/mongodb/src/test/java/org/apache/calcite/test/MongoAssertions.java:43: > > error: reference not found > > > [ERROR] /** Similar to {@link CalciteAssert#checkResultUnordered}, > but > > f

Re: Elasticsearch Adapter. Removal of Mapping Types (by vendor). Index == Table

2018-06-30 Thread Andrei Sereda
add configuration parameter which allows to specify a (eg. regexp) filter for ES indexes ? On Fri, Jun 29, 2018 at 11:17 PM Andrei Sereda wrote: > That's a reasonable alternative. > > On Fri, Jun 29, 2018 at 7:57 PM Julian Hyde wrote: > >> Maybe there could be a sep

Re: Intermediate failure of materialized views in Cassandra adapter

2018-07-27 Thread Andrei Sereda
Build is passing now. JDK11 explicitly skipped due to cassandra compatibility. Have to wait for Cassandra 4.x (to run on JDK11) which is not yet released. Feel free to take my commit 981ab2888 from PR#769 or merge it directly. On Fri, Jul 27, 2018 at 5:23 PM Andrei Sereda wrote: > I h

RelBuilder API on the top of a view

2018-08-02 Thread Andrei Sereda
Hello, I was wondering if one can use relational algebra API on the top of existing view (or only tables are supported) ? Below is an example which fails for me : // suppose one creates a view as follows CREATE VIEW view AS select * from

Re: RelBuilder API on the top of a view

2018-08-02 Thread Andrei Sereda
contains a view) or ServerTest (where > you could execute CREATE VIEW and then start a RelBuilder on the > connection). > > Julian > > > > > > On Aug 2, 2018, at 2:57 PM, Andrei Sereda wrote: > > > > Hello, > > > > I was wondering if one can use

Re: CassandraAdapterTest failure

2018-08-03 Thread Andrei Sereda
While trying to fix Sergey's issue with stale folder (see CALCITE-2442) I realized that CassandraUnit wasn't shutting down the cluster. So I've added a manual tearDown() method which explicitly calls close() on both session and cluster: https://github.com/apache/calcite/pull/775 Can you pls

Re: RelBuilder API on the top of a view

2018-08-02 Thread Andrei Sereda
Created JIRA: https://issues.apache.org/jira/browse/CALCITE-2441 PR (for failing test): https://github.com/apache/calcite/pull/774 I'm happy to fix it if you think it can be done in similar manner to ViewExpanderImpl (ie I'm not missing anything). On Thu, Aug 2, 2018 at 7:02 PM Andrei Sereda

Re: CassandraAdapterTest failure

2018-07-30 Thread Andrei Sereda
avoid > timeouts whenever possible. > > Julian > > > > On Jul 30, 2018, at 9:30 AM, Andrei Sereda wrote: > > > > Pls check and confirm that the following PR fixes the issue: > > https://github.com/apache/calcite/pull/770 > > It addresses build failur

Re: CassandraAdapterTest failure

2018-07-30 Thread Andrei Sereda
Pls check and confirm that the following PR fixes the issue: https://github.com/apache/calcite/pull/770 It addresses build failures due to version parsing. Stale folders / files will be addressed in a different PR. On Mon, Jul 30, 2018 at 10:10 AM Andrei Sereda wrote: > This must be someth

Re: CassandraAdapterTest failure

2018-07-30 Thread Andrei Sereda
by the end of tests > Is there a way to make cassandra generates these files in target directory > e.g.? > > > > On Mon, Jul 30, 2018 at 3:52 PM, Andrei Sereda wrote: > > > Most of the problems are during test init Phase. Most likely with version > > string (eg. 11-

Re: CassandraAdapterTest failure

2018-07-30 Thread Andrei Sereda
eDriverTest) > > Time elapsed: 0.047 s <<< FAILURE! > > java.lang.AssertionError: > > > > Expected: "EXPR$0=1; EXPR$1=a\nEXPR$0=null; EXPR$1=b" > > but: was "" > > at > > > org.apache.calcite.jdbc.CalciteRemoteDr

Re: CassandraAdapterTest failure

2018-07-30 Thread Andrei Sereda
alization. (Andrei Sereda) > > the commit comment should be > > [CALCITE-2428] Cassandra unit test fails to parse version string (Andrei > Sereda) > > Julian > > > > On Jul 30, 2018, at 1:13 PM, Michael Mior wrote: > > > > Thanks Andrei for diggin

Re: CassandraAdapterTest failure

2018-07-29 Thread Andrei Sereda
What version of java / OS / maven do you have ? What is your maven command ? Things pass for me on MacOS X java 8,9 and 10. On Sun, Jul 29, 2018 at 2:05 PM Julian Hyde wrote: > I'm seeing the following error when I run the tests on bd0e14002 > origin/master. Anyone else see it? > > [INFO]

Re: Intermediate failure of materialized views in Cassandra adapter

2018-07-26 Thread Andrei Sereda
> mm...@apache.org > > > > Le mer. 25 juil. 2018 à 19:41, Andrei Sereda a écrit : > > > My issue was with JDK10 and maven javadoc plugin (see MJAVADOC-517 > > <https://issues.apache.org/jira/browse/MJAVADOC-517>) > > > > Can you double-check i

Re: Intermediate failure of materialized views in Cassandra adapter

2018-07-26 Thread Andrei Sereda
rException* * at org.apache.cassandra.config.DatabaseDescriptor.getDiskFailurePolicy(DatabaseDescriptor.java:1881)* at org.apache.cassandra.utils.JVMStabilityInspector.inspectThrowable(JVMStabilityInspector.java:82) at org.apache.cassandra.io.util.FileUtils.(FileUtils.java:79) ... 14 more Regards, Andrei. On Thu, Jul 26, 2018 at 2:55 PM Andrei Sereda wrote: &g

Re: Intermediate failure of materialized views in Cassandra adapter

2018-07-25 Thread Andrei Sereda
to merge the > branch with CassandraUnit until tests pass). > > -- > Michael Mior > mm...@apache.org > > > > Le mer. 25 juil. 2018 à 16:36, Andrei Sereda a écrit : > > > Mike, > > > > Is your branch michaelmior:2419-cassandra-un

Re: Intermediate failure of materialized views in Cassandra adapter

2018-07-25 Thread Andrei Sereda
en all the tests and each test (after setup) runs rather quickly so I > don't think running the tests serially is a problem. I've never seen the > error you're seeing before. A full stack trace might help. > > -- > Michael Mior > mm...@apache.org > > > > Le mer. 25 jui

Re: CassandraAdapterTest failure

2018-08-01 Thread Andrei Sereda
Or maybe you already have a Cassandra instance binded to port 9142 (virtual machine for example) ? On Wed, Aug 1, 2018 at 7:28 PM Andrei Sereda wrote: > Is it possible that you run several maven processes in parallel ? > > Unfortunately currently there can be only one CassandraAd

Re: CassandraAdapterTest failure

2018-08-01 Thread Andrei Sereda
Is it possible that you run several maven processes in parallel ? Unfortunately currently there can be only one CassandraAdapterTest (setup() method really) running on a box in parallel. On Wed, Aug 1, 2018 at 4:55 PM Andrei Sereda wrote: > Hi Julian, > > Can you please tell if you'r

Re: CassandraAdapterTest failure

2018-08-01 Thread Andrei Sereda
e command “mvn > -Pit > > >> clean test” will probably reproduce it for most people. > > >> > > >> Can other folks please try to reproduce this? I’m getting close to > > saying > > >> that we should back this change out even though apparently

Re: Intermediate failure of materialized views in Cassandra adapter

2018-07-27 Thread Andrei Sereda
JDK11 ? On Fri, Jul 27, 2018 at 4:39 PM Andrei Sereda wrote: > Take a look at my branch c389451 : > > > https://github.com/asereda-gs/calcite/commit/c38945122e1edf4b417db6b82823b4a1b8c2c8b5 > > It works both with Maven and IntelliJ > > On Fri, Jul 27, 2018 at 10:36 AM Michae

Re: Intermediate failure of materialized views in Cassandra adapter

2018-07-27 Thread Andrei Sereda
ser > myself. Thanks! > > -- > Michael Mior > mm...@uwaterloo.ca > > > Le jeu. 26 juil. 2018 à 22:11, Andrei Sereda a écrit : > > > I think there are several problems: > > > > 1) "target/embeddedCassandra" is not in the classpath (of cassa

Re: Intermediate failure of materialized views in Cassandra adapter

2018-07-25 Thread Andrei Sereda
Mike, Is your branch michaelmior:2419-cassandra-unit up to date ? I'm getting NPE: > Caused by: java.lang.NullPointerException > at > org.apache.cassandra.config.DatabaseDescriptor.getDiskFailurePolicy(DatabaseDescriptor.java:1881) > at >

Re: Bindable Baz.bind(DataContext) issue

2018-08-09 Thread Andrei Sereda
Dylan, The query translation is happening in PredicateAnalyzer (called inside ElasticsearchFilter). Any reason why you want match query instead of term

Re: Bindable Baz.bind(DataContext) issue

2018-08-09 Thread Andrei Sereda
eful later to know where this is done :) > > Thanks again, > > Dylan > > > From: "Andrei Sereda" > To: dev@calcite.apache.org > Sent: Thursday, August 9, 2018 3:28:56 PM > Subject: Re: Bindable Baz.bind(DataContext) issue > > Dylan, > > The query t

nested structs. querying and building metadata in calcite

2018-08-11 Thread Andrei Sereda
Hello Calcite Devs, I would like to ask your advice on the following use-case. Let’s say one wants to automatically construct (and then query) row type RelDataType out of existing model. In the case of elastic (but probably applicable to other databases as well) there is a notion of mappings

Re: nested structs. querying and building metadata in calcite

2018-08-13 Thread Andrei Sereda
Thanks all for your answers. I still have one question / clarification regarding semantics of select * for document databases (with declared schema). Say I have the following type definition: CREATE TYPE mytype AS ( a varchar(2) not null, b varchar(2) NULL // optional (null?) ); If my

full table scans and subQueryThreshold

2018-08-13 Thread Andrei Sereda
Hello, I have noticed that our queries get converted into full table scans when they contain IN predicates with long list of elements (eg. id IN ($manyIds) ). Upon some debuging the reason seems to be SqlToRelConverter.substituteSubQuery()

Re: Docker test environment

2018-08-13 Thread Andrei Sereda
Hi Igor, > Also, I observed moving calcite integration tests to an in-memory database(MongoDB, ElasticSearch, Cassandra). Why don't I like it? I would like to address some concerns you have raised with recent changes to adapter testing in calcite. The main drive for those changes was to run

Re: full table scans and subQueryThreshold

2018-08-23 Thread Andrei Sereda
here's also a rule which tries to > close ORs into an IN. > > https://github.com/apache/hive/blob/236a32c645a21b04ccaf7f18db5c6a5aa53586e8/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HivePointLookupOptimizerRule.java#L217 > > I plan to get back to this; or at least get CA

Re: Assign alias to a column in RelBuilder

2018-08-23 Thread Andrei Sereda
The following works for me @Test public void relBuilderProjectAlias() throws Exception { final RelBuilder builder = RelBuilder.create(config().build()); final RelNode root = builder.scan("EMP") .project( builder.alias(builder.field("EMPNO"), "aaa"),

code review: CALCITE-2485. Wrong single projection in Elastic adapter

2018-08-28 Thread Andrei Sereda
Hello, Can somebody pls take a look at PR801 (CALCITE-2485 ). It is a fix for ES adapter bug (bad logic for single element projections). Thank you, Andrei.

joins and low selectivity optimization

2018-08-28 Thread Andrei Sereda
Hello, I’m looking for a way to improve performance of a join query. Suppose one joins two heterogeneous sources t1 and t2 with some predicates. Further assume that cardinality of one of the predicates is very low (compared cardinality of the second one). (How) Is it possible to convert second

Re: joins and low selectivity optimization

2018-08-28 Thread Andrei Sereda
u're likely to have a > tough > > time extracting the necessary data to do the rewrite you're aiming for. > > > > -- > > Michael Mior > > mm...@apache.org > > > > > > > > Le mar. 28 août 2018 à 20:34, Andrei Sereda a écrit : > > > >> Hello,

Re: Calcite-MongoDB-Joins operations support

2018-07-24 Thread Andrei Sereda
You can do joins but they will happen outside mongo (ie calcite does not use $lookup operator or such). On Tue, Jul 24, 2018 at 2:23 PM Satiz Kumar wrote: > Hi Calcite DEV Team, > > I am trying to use Calcite with my

Re: [ANNOUNCE] Apache Calcite 1.17.0 released

2018-07-21 Thread Andrei Sereda
If people are interested I can prepare breaking changes paragraph for ES adapter. On Sat, Jul 21, 2018 at 1:17 PM Enrico Olivelli wrote: > Il sab 21 lug 2018, 18:25 Julian Hyde ha scritto: > > > Enrico, > > > > I agree. This release had so much good stuff that we were bound to miss > > some.

Re: No data returned from mongodb table - calcite

2018-07-24 Thread Andrei Sereda
Hi Kumar, Probably, the problem is that mongo (Bson) documents are not shown correctly. Try to fetch individual attributes like : select _MAP['_id'], _MAP['attr1'] from "users" You can always double-check result size with select count(*) from "users" Regards, Andrei. On Tue, Jul 24, 2018

identifying original SQL functions after rewrites (in adapters)

2018-08-30 Thread Andrei Sereda
Hello, I’m trying to implement COALESCE for elastic adapter and would like to know what is recommended approach to identify original function (after possible rewrites). Let me give an example. Currently calcite converts COALESCE(attr, 'foo') into CASE(IS NOT NULL(attr), attr, 'foo'). So in

Re: joins and low selectivity optimization

2018-08-29 Thread Andrei Sereda
Hi Vladimir, Thanks for follow-up and explanation. I wanted to make sure I'm not missing (mis-understanding) anything. Andrei. On Wed, Aug 29, 2018 at 11:01 AM Vladimir Sitnikov < sitnikov.vladi...@gmail.com> wrote: > One of the approaches to such queries is to throw Bloom filters all over >

Re: joins and low selectivity optimization

2018-08-29 Thread Andrei Sereda
y, remove “WHERE x < 10” > if a month ago x only had values 2, 4, and 6. > > > On Aug 28, 2018, at 7:14 PM, Andrei Sereda wrote: > > > > Thank you, Michael and Julian, for your answers. > > > > Even if optimizers don't have access to data can they have access t

Re: calcite git commit: [CALCITE-2498] fix bug when geode adapter quotes booleans as strings (Andrei Sereda)

2018-09-01 Thread Andrei Sereda
> > > On Aug 31, 2018, at 6:55 PM, vladimirsitni...@apache.org wrote: > > > > Repository: calcite > > Updated Branches: > > refs/heads/master 2817bda61 -> 9589a3606 > > > > > > [CALCITE-2498] fix bug when geode adapter quotes booleans as strings

Review Request for CALCITE-2528. Support Aggregates in ElasticSearch Adapter

2018-09-08 Thread Andrei Sereda
Hello, Can somebody please review the following PR: 822 (CALCITE-2528 ) ? It enhances ElasticSearch adapter with native ES aggregations

Re: [DISCUSS] Towards Calcite 1.17.0

2018-07-06 Thread Andrei Sereda
I have created PR-753 for CALCITE-2331. Please note it fixes only ES adapter (mongo is also affected). On Thu, Jun 28, 2018 at 1:54 PM Michael Mior wrote: > I'll add CALCITE-2331 as at least a nice-to-have. I believe Andrei is > working on a PR and

Elasticsearch Adapter. Removal of Mapping Types (by vendor). Index == Table

2018-06-28 Thread Andrei Sereda
Hello, Elastic announced that they will be deprecating mapping types in ES6 and indexes will be single-typed only. Historical analogy between RDBMS and elastic was

Re: Elasticsearch Adapter. Removal of Mapping Types (by vendor). Index == Table

2018-06-28 Thread Andrei Sereda
ame to index name map and be able to > support both scenarios. > > > Mit freundlichen Grüßen, > -------- > *Christian Beikov* > Am 29.06.2018 um 00:12 schrieb Andrei Sereda: > >> 1) What's the time horizon for the curren

Re: [2/2] calcite git commit: [CALCITE-2347] running ElasticSearch in embedded mode for unit tests of ES adapter (Andrei Sereda)

2018-06-28 Thread Andrei Sereda
y PC as before. > > Kind regards, > Volodymyr Vysotskyi > > > чт, 28 черв. 2018 о 01:03 Andrei Sereda пише: > > > Submitted PR-744 <https://github.com/apache/calcite/pull/744> to unify > > ES2 > > and ES5. > > Javadoc Classpath collisions sh

Re: Elasticsearch Adapter. Removal of Mapping Types (by vendor). Index == Table

2018-06-28 Thread Andrei Sereda
ed work on the ES adapter Andrei! > > -- > Michael Mior > mm...@apache.org > > > > Le jeu. 28 juin 2018 à 12:57, Andrei Sereda a écrit : > > > Hello, > > > > Elastic announced > > < > > > https://www.elastic.co/guide/en/elasticsearch/refer

Re: [2/2] calcite git commit: [CALCITE-2347] running ElasticSearch in embedded mode for unit tests of ES adapter (Andrei Sereda)

2018-06-28 Thread Andrei Sereda
b/src/test/java/org/apache/calcite/test/MongoAssertions.java:36: > error: reference not found > [ERROR] * Util class which needs to be in the same package as {@link > CalciteAssert} > [ERROR] ^ > > Kind regards, > Volodymyr Vysotskyi > > > чт, 28 черв. 2018 о 23:07 A

Re: Generic Map type (_MAP) and select star (*)

2018-10-05 Thread Andrei Sereda
o understand how RelRoot is used the best way would be to > start from the creation of the object in CalcitePrepareImpl class.( > > https://github.com/apache/calcite/blob/c39bfaa02a06ac91575076a6e74f29863923f5eb/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java#L1113 > ) >

Re: Elastic Search adapter not identifying columns

2018-10-22 Thread Andrei Sereda
Hi Kumar, Currently elastic adapter doesn't automatically import document mappings . You need to either: 1) Manually define view

Re: Generic Map type (_MAP) and select star (*)

2018-10-24 Thread Andrei Sereda
e other hand, I am not sure I understand what names are missing in the > example you posted. > I suppose that instead of EXPR$1, EXPR$2, EXPR$3 you are expecting > something different. > Can you provide an example of what is missing? > > Best, > Stamatis > > > > >

scrolling in ElasticSearch adapter

2018-10-24 Thread Andrei Sereda
Hello, I was thinking about adding [scrolling functionality]( https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html) to elastic search adapter. Since scrolling has non-negligible effect on the cluster it should be selectively enabled on per query basis. So,

Re: scrolling in ElasticSearch adapter

2018-10-24 Thread Andrei Sereda
ations are accessible for data > stores or dialects, but IMO using these would be the proper way. > > Regards > > Christian > > Am 24.10.2018 um 18:44 schrieb Andrei Sereda: > > Hello, > > > > > > I was thinking about adding [scrolling functionality]( >

Re: scrolling in ElasticSearch adapter

2018-10-24 Thread Andrei Sereda
gt; > > Not sure though if or how these configurations are accessible for data > stores or dialects, but IMO using these would be the proper way. > > > > Regards > > > > Christian > > > >> Am 24.10.2018 um 18:44 schrieb Andrei Sereda: > >> Hel

Re: scrolling in ElasticSearch adapter

2018-10-24 Thread Andrei Sereda
ed to the client. The > client may decide to iterate through all/some of them but that does not > change the fact that the server must be able to provide the complete result. > > Best, > Stamatis > > Στις Τετ, 24 Οκτ 2018 στις 9:39 μ.μ., ο/η Andrei Sereda > έγραψε: > &

Re: scrolling in ElasticSearch adapter

2018-10-24 Thread Andrei Sereda
; > According to the JDBC spec > (https://docs.oracle.com/javase/7/docs/api/java/sql/Connection.html#prepareStatement(java.lang.String,%20int,%20int) > ) you don't have to support all modes. Usually, user code doesn't use > scrolling that much, but at least forward scrolling makes sense. >

Re: Provide model.json file from Resources in Jar

2018-10-29 Thread Andrei Sereda
I think calcite supports inline: prefix in properties (for models). Try to add the following to properties: Properties props = new Properties(); prop.put("model", "inline:" + longString); On Mon, Oct 29, 2018 at 3:00 PM Julian Hyde wrote: > I thought there was a way to read models from jars.

Re: Provide model.json file from Resources in Jar

2018-10-29 Thread Andrei Sereda
and files in > the classpath (e.g. in jars). > > > On Oct 29, 2018, at 12:09 PM, Andrei Sereda wrote: > > > > I think calcite supports inline: prefix in properties (for models). Try > to > > add the following to properties: > > > > Properties props = new Proper

Re: scrolling in ElasticSearch adapter

2018-10-25 Thread Andrei Sereda
t; at scrolling as an optimization the default results won't be correct (ie: > only returning 10 results when there are a lot more). For default > pagination there is a limit of 1 results anyway unless you use > scrolling or search after. > > Kevin Risden > > > On Thu, Oct

  1   2   3   4   >