Re: [DISCUSS] restrict JDK test matrix

2022-10-03 Thread Julian Hyde
It makes sense to only test on 8, 11, 17 and the latest. Testing on other 
versions is going to waste time checking on false negatives. I don’t remember 
whether there’s ever been an issue on, say, 15, that wasn’t also present in 11 
or 17. 

Maybe it’s a distinction without a difference, but I think we should still 
support the full range of JDK versions.  If I submit a change that breaks the 
build on JDK 13, you should tell me and I should fix it. I don’t use sdkman and 
can create a JDK 13 environment easily enough from the JDK’s binary tarball. 

Julian 

> On Oct 3, 2022, at 5:38 AM, Alessandro Solimando 
>  wrote:
> 
> Hello everyone,
> I was checking a build failure
>  related to
> JDK15 and I wanted to try it locally, however I can't do it via sdkman
>  (a "multi-platform software manager") as JDK is not
> anymore available. This is not the first time, and it makes review tasks
> complicated sometimes (in this specific case it seems an ENV issue, but
> that's not the point here).
> 
> I wanted to discuss with you if we really want to keep those "recent but
> EOL" versions or not in our test matrix.
> 
> I know that JDK8 is EOL too, but lots of projects are still based on it and
> it's sadly running in PROD in many places for the same reason. In my (maybe
> limited) experience, those who upgraded to newer versions (> 11), aren't
> likely to get stuck at, say, 15 and can't move to 17. Is my assumption
> correct in your experience?
> 
> In my sdkman on MacOS I only see JDK 8, 11, 17, 20, 21, 22, and I strongly
> suspect they are following some criteria based on LTS/EOL versions.
> 
> Shall we try to do something similar for Calcite and remove non-LTS+EOL
> versions higher than 11?
> 
> Best regards,
> Alessandro


[REVIEW REQUEST] CALCITE-5230 PERCENTILE_DISC return type derivation

2022-10-03 Thread Itiel Sadeh
Hello,
I would like to request review for CALCITE-5230, which fixes the return
type derivation of PERCENTILE_DISC.

PR: https://github.com/apache/calcite/pull/2868
Ticket: https://issues.apache.org/jira/browse/CALCITE-5230

Thanks!


Re: Draft: board report for 2022 Q3

2022-10-03 Thread Alessandro Solimando
+1 Ruben, great summary!

On Sun, 2 Oct 2022 at 17:36, Julian Hyde  wrote:

> +1
>
> You’ve painted a good picture of what’s going on. I think the Board will
> appreciate.
>
> My personal update: I’m sitting on the runway heading to New Orleans for
> ApacheCon. Planning to present, but also represent Calcite! If any of you
> are there, please get in touch.
>
> Julian
>
> > On Oct 2, 2022, at 07:22, Benchao Li  wrote:
> >
> > +1, thanks Ruben for preparing the report!
> >
> > Francis Chuang  于2022年10月2日周日 18:06写道:
> >
> >> +1 Looks great, Ruben!
> >>
> >>> On 2/10/2022 8:59 pm, Ruben Q L wrote:
> >>> Hello,
> >>>
> >>> Below these lines you can find a draft of this quarter's board report.
> I
> >>> plan to submit it
> >>> before Friday next week.
> >>> Please let me know if you have any additions or corrections.
> >>>
> >>> Best regards,
> >>> Ruben
> >>>
> >>> -
> >>>
> >>>
> >>> ## Description:
> >>> Apache Calcite is a highly customizable framework for parsing and
> >> planning
> >>> queries on data in a wide variety of formats. It allows database-like
> >>> access,
> >>> and in particular a SQL interface and advanced query optimization, for
> >> data
> >>> not residing in a traditional database.
> >>>
> >>> Avatica is a sub-project within Calcite and provides a framework for
> >>> building
> >>> local and remote JDBC and ODBC database drivers. Avatica has an
> >> independent
> >>> release schedule and its own repository.
> >>>
> >>> ## Issues:
> >>> There are no issues requiring board attention.
> >>>
> >>> ## Membership Data:
> >>> Apache Calcite was founded 2015-10-22 (7 years ago)
> >>> There are currently 58 committers and 26 PMC members in this project.
> >>> The Committer-to-PMC ratio is roughly 2:1.
> >>>
> >>> Community changes, past quarter:
> >>> - Andrei Sereda was added to the PMC on 2022-08-08
> >>> - Jing Zhang was added as committer on 2022-07-04
> >>> - Benchao Li was added as committer on 2022-07-04
> >>>
> >>> ## Project Activity:
> >>> Apache Calcite 1.31.0 was released on 2022-08-02. It contains
> >> contributions
> >>> from 28 contributors, and resolves 81 issues. Among others, it is worth
> >>> highlighting the following improvements: Allow table functions to be
> >>> polymorphic; Support SQL hint for Filter, SetOp, Sort, Window, Values;
> >>> Support
> >>> parsing parenthesized joins; Derive IS NOT NULL filter for the inputs
> of
> >>> inner
> >>> join; and Firebolt dialect implementation.
> >>>
> >>> Apache Calcite 1.32.0 was released on 2022-09-10, with 19 issues fixed
> >> by 17
> >>> contributors. This release fixes CVE-2022-39135, an XML External Entity
> >>> (XEE)
> >>> vulnerability that allows a SQL query to read the contents of files via
> >> the
> >>> SQL functions EXISTS_NODE, EXTRACT_XML, XML_TRANSFORM or EXTRACT_VALUE.
> >>> Apart
> >>> from that, it is worth highlighting that this release also replaces the
> >> ESRI
> >>> spatial engine with JTS and proj4j, adds 65 spatial SQL functions
> >> including
> >>> ST_Centroid, ST_Covers and ST_GeomFromGeoJSON, adds the CHAR SQL
> >> function,
> >>> and
> >>> improves the return type of the ARRAY and MULTISET functions.
> >>>
> >>> Apache Calcite Avatica 1.22.0 was released on 2022-07-28. This is a
> >>> maintenance release to resolve CVE-2022-36364: Apache Calcite Avatica
> >> JDBC
> >>> driver httpclient_impl connection property can be used as an RCE
> vector.
> >>>
> >>> ## Community Health:
> >>> The community maintains a healthy status. There has been a generalized
> >>> decrease in the Jira & Github activity in the last quarter (-14% issues
> >>> opened, -27% issues closed, -25% commits, -21% code contributions, -11%
> >> PRs
> >>> opened, -40% PRs closed). This is expected since many members of the
> >>> community
> >>> were probably on vacation during this summertime in the Northern
> >> Hemisphere.
> >>> Nevertheless, the development mailing list has kept a big activity,
> even
> >>> increasing its traffic 137% in this quarter.
> >>>
> >>> Is is worth mentioning that several vulnerabilities were reported in
> both
> >>> Calcite and Avatica, and the PMC showed a great reactivity to deal with
> >> them
> >>> swiftly.
> >>>
> >>> The number of non-committer (contributor) commits per month:
> >>> +-+-+-+
> >>> |year |month| contributor_commits |
> >>> +-+-+-+
> >>> | 2022| 7   | 0   |
> >>> | 2022| 8   | 5   |
> >>> | 2022| 9   | 15  |
> >>> +-+-+-+
> >>>
> >>> The number of active reviewers per month:
> >>> +-+-+-+
> >>> |year |mon

[DISCUSS] restrict JDK test matrix

2022-10-03 Thread Alessandro Solimando
Hello everyone,
I was checking a build failure
 related to
JDK15 and I wanted to try it locally, however I can't do it via sdkman
 (a "multi-platform software manager") as JDK is not
anymore available. This is not the first time, and it makes review tasks
complicated sometimes (in this specific case it seems an ENV issue, but
that's not the point here).

I wanted to discuss with you if we really want to keep those "recent but
EOL" versions or not in our test matrix.

I know that JDK8 is EOL too, but lots of projects are still based on it and
it's sadly running in PROD in many places for the same reason. In my (maybe
limited) experience, those who upgraded to newer versions (> 11), aren't
likely to get stuck at, say, 15 and can't move to 17. Is my assumption
correct in your experience?

In my sdkman on MacOS I only see JDK 8, 11, 17, 20, 21, 22, and I strongly
suspect they are following some criteria based on LTS/EOL versions.

Shall we try to do something similar for Calcite and remove non-LTS+EOL
versions higher than 11?

Best regards,
Alessandro


JSON Array as table using ScannableTable

2022-10-03 Thread Kartik Kudada
Hi Calcite Community Developers,

I have JSON array, which I  like to use as a table for query like "select *
from jsonTable".
I followed as given tutorials (youtube
) but got a
ClassCastException [ com.google.gson.JsonObject cannot be cast to
[Ljava.lang.Object]
I checked implementations of org.apache.calcite.schema.ScannableTable which
can support for JsonArray. but didn't find any.

Any help would be appreciated.

// My code snippet .

JsonAray jsonArray = // JsonArray consists of employee details

RelDataTypeFactory typeFactory = new JavaTypeFactoryImpl();

RelDataType tableType = typeFactory.builder()
.add("name", SqlTypeName.VARCHAR)
.add("dob",SqlTypeName.TIMESTAMP)
.add("age",SqlTypeName.INTEGER)
.build();
ListTable jsonTable = new ListTable(tableType,jsonArray);
getConnection().getRootSchema().add("jsonTable",jsonTable);


ListTable class :

public class ListTable extends AbstractTable implements ScannableTable {
  private final RelDataType rowType;
  private final JsonArray data;

@Override

public Enumerable scan(final DataContext root) { return
Linq4j.asEnumerable(data);}
@Override

public RelDataType getRowType(final RelDataTypeFactory typeFactory) {
return rowType;}

}


Reference for tutorials : youtube
 and github



Regards,

Kartik