Re: Parsing Teradata SQL with Apache Calcite

2020-03-28 Thread David Valenzuela Rodriguez
Hi,

In order to define the TD library, it looks like I'd basically need to
modify the following:

   -
   
https://github.com/apache/calcite/blob/888dd3a7d20ad04b22434f16d96177b7ca2c28aa/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
   -
   
https://github.com/apache/calcite/blob/52a57078ba081b24b9d086ed363c715485d1a519/core/src/main/java/org/apache/calcite/sql/fun/SqlLibrary.java


Is that accurate?

Thanks!
David

On Thu, Mar 26, 2020 at 5:13 PM David Valenzuela Rodriguez <
davi...@groupon.com> wrote:

> Awesome, thanks!
>
> David
>
> On Thu, Mar 26, 2020 at 4:02 PM Julian Hyde  wrote:
>
>> There are a few related concepts that make up the general idea of
>> "dialect":
>> * *dialect* determines how the JDBC adapter convert SqlNodes to SQL
>> (e.g. generate "LIMIT 5" or "FETCH 5 ROWS")
>> * *conformance* determines what features the validator will allow
>> (e.g. does "GROUP BY 1" mean group by the first field or the literal
>> 1)
>> * *parserConfig* parameters control the parser, for example
>> identifiers (quoted using brackets, or back-ticks or double-quotes),
>> and how it treats the case of quoted and unquoted identifiers
>> * *library* is a set of built-in functions. For example, you might
>> want to use standard SQL functions plus Oracle's function set (e.g.
>> DECODE)
>> * *type system* determines things such as what is the maximum length
>> of a VARCHAR value
>>
>> These are intentionally kept separate in the code. We built a bridge
>> between dialect parserConfig in
>> https://issues.apache.org/jira/browse/CALCITE-3050. It's worth reading
>> that issue for the back-story.
>>
>> To parse Teradata SQL, you probably need to create a library (for
>> functions) and a conformance. Maybe a new constant Lex.TERADATA.
>>
>> Julian
>>
>>
>> If you want to parse Tera
>>
>> On Thu, Mar 26, 2020 at 3:44 PM David Valenzuela Rodriguez
>>  wrote:
>> >
>> > Hi!
>> >
>> > I'm currently evaluating the Apache Calcite framework for the purposes
>> of
>> > parsing Teradata SQL. As far as I can tell, this is accomplished by
>> > defining a SqlOperatorTable with TD-specific operators. Other than that,
>> > I'm not really sure how to integrate that SqlOperatorTable into the
>> > Parser/Planner. Are there any guidelines or examples of this? I haven't
>> > really seen this, but I assume this is not something new.
>> >
>> > Thanks in advance!
>> >
>> > --
>> > David Valenzuela
>> > Software Engineer | Data & Discovery | GROUPON
>> > mobile 425.614.5243
>> > davi...@groupon.com
>>
>
>
> --
> David Valenzuela
> Software Engineer | Data & Discovery | GROUPON
> mobile 425.614.5243
> davi...@groupon.com
>


-- 
David Valenzuela
Software Engineer | Data & Discovery | GROUPON
mobile 425.614.5243
davi...@groupon.com


[jira] [Created] (CALCITE-3885) Reestablish trace logging for rules queue and Volcano planner

2020-03-28 Thread Roman Kondakov (Jira)
Roman Kondakov created CALCITE-3885:
---

 Summary: Reestablish trace logging for rules queue and Volcano 
planner
 Key: CALCITE-3885
 URL: https://issues.apache.org/jira/browse/CALCITE-3885
 Project: Calcite
  Issue Type: Improvement
  Components: core
Reporter: Roman Kondakov
 Fix For: next


After fixing CALCITE-3753 the opportunity of tracing the rules queue and 
{{VolcanoPlanner}} search space state is disappeared.  We should restore this 
opportunity.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Build failed in Jenkins: Calcite-Snapshots #140

2020-03-28 Thread Apache Jenkins Server
See 


Changes:

[h.yuan] [CALCITE-3867] Support RelDistribution json serialization (Krisztian


--
[...truncated 110.88 KB...]
> Configure project :example:csv
Evaluating project ':example:csv' using build file 
'

> Configure project :example:function
Evaluating project ':example:function' using build file 
'
All projects evaluated.
Selected primary task 'publish' from project :
file or directory 
'
 not found
file or directory 
'
 not found
file or directory 
'
 not found
file or directory 
'
 not found
Tasks to be executed: [task ':publish', task ':linq4j:compileJava', task 
':core:compileKotlin', task ':core:fmppMain', task ':core:javaCCMain', task 
':core:versionClass', task ':core:compileJava', task ':babel:compileKotlin', 
task ':babel:fmppMain', task ':babel:javaCCMain', task ':babel:compileJava', 
task ':babel:processResources', task ':babel:classes', task 
':babel:inspectClassesForKotlinIC', task ':babel:jar', task 
':babel:generateMetadataFileForBabelPublication', task 
':babel:generatePomFileForBabelPublication', task ':gitProps', task ':rat', 
task ':validateBeforeBuildingReleaseArtifacts', task 
':validateNexusCredentials', task ':initializeNexusStagingRepository', task 
':babel:initializeNexusStagingRepository', task ':babel:javadoc', task 
':babel:javadocJar', task ':babel:sourcesJar', task 
':babel:publishBabelPublicationToNexusRepository', task ':babel:publish', task 
':cassandra:compileJava', task ':cassandra:processResources', task 
':cassandra:classes', task ':cassandra:jar', task 
':cassandra:generateMetadataFileForCassandraPublication', task 
':cassandra:generatePomFileForCassandraPublication', task 
':cassandra:initializeNexusStagingRepository', task ':cassandra:javadoc', task 
':cassandra:javadocJar', task ':cassandra:sourcesJar', task 
':cassandra:publishCassandraPublicationToNexusRepository', task 
':cassandra:publish', task ':core:processResources', task ':core:classes', task 
':core:inspectClassesForKotlinIC', task ':core:jar', task 
':core:generateMetadataFileForCorePublication', task 
':core:generatePomFileForCorePublication', task 
':core:initializeNexusStagingRepository', task ':core:javadoc', task 
':core:javadocJar', task ':core:sourcesJar', task ':core:compileTestKotlin', 
task ':core:fmppTest', task ':core:javaCCTest', task ':core:compileTestJava', 
task ':core:processTestResources', task ':core:testClasses', task 
':core:testJar', task ':core:publishCorePublicationToNexusRepository', task 
':core:publish', task ':druid:compileJava', task ':druid:processResources', 
task ':druid:classes', task ':druid:jar', task 
':druid:generateMetadataFileForDruidPublication', task 
':druid:generatePomFileForDruidPublication', task 
':druid:initializeNexusStagingRepository', task ':druid:javadoc', task 
':druid:javadocJar', task ':druid:sourcesJar', task 
':druid:publishDruidPublicationToNexusRepository', task ':druid:publish', task 
':elasticsearch:compileJava', task ':elasticsearch:processResources', task 
':elasticsearch:classes', task ':elasticsearch:jar', task 
':elasticsearch:generateMetadataFileForElasticsearchPublication', task 
':elasticsearch:generatePomFileForElasticsearchPublication', task 
':elasticsearch:initializeNexusStagingRepository', task 
':elasticsearch:javadoc', task ':elasticsearch:javadocJar', task 
':elasticsearch:sourcesJar', task 
':elasticsearch:publishElasticsearchPublicationToNexusRepository', task 
':elasticsearch:publish', task ':example:csv:compileJava', task 
':file:compileJava', task ':file:processResources', task ':file:classes', task 
':file:jar', task ':file:generateMetadataFileForFilePublication', task 
':file:generatePomFileForFilePublication', task 
':file:initializeNexusStagingRepository', task ':file:javadoc', task 
':file:javadocJar', task ':file:sourcesJar', task 
':file:publishFilePublicationToNexusRepository', task ':file:publish', task 
':geode:compileJava', task ':geode:processResources', task ':geode:classes', 
task ':geode:jar', task ':geode:generateMetadataFileForGeodePublication', task 
':geode:generatePomFileForGeodePublication', task 
':geode:initializeNexusStagingRepository', task ':geode:javadoc', task 
':geode:javadocJar', task ':geode:sourcesJar', task 
':geode:publishGeodePublicationToNexusRepository', task ':geode:publish', task 
':kafka:compileJava', task ':kafka:processResources', task ':kafka:classes',

[jira] [Created] (CALCITE-3886) Execute substitution rule according to the order they get matched

2020-03-28 Thread Haisheng Yuan (Jira)
Haisheng Yuan created CALCITE-3886:
--

 Summary: Execute substitution rule according to the order they get 
matched
 Key: CALCITE-3886
 URL: https://issues.apache.org/jira/browse/CALCITE-3886
 Project: Calcite
  Issue Type: Improvement
  Components: core
Reporter: Haisheng Yuan


Currently the substitution rule is always appended to the head of the queue. We 
prefer to executing the rule according to the order they get matched. So we 
need a separate queue for substitution rule matches.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Build failed in Jenkins: Calcite-Snapshots #141

2020-03-28 Thread Apache Jenkins Server
See 


Changes:

[15352793+hsyuan] [CALCITE-3886] Execute substitution rule according to the 
order they get

[15352793+hsyuan] Following [CALCITE-3819] Prune parent RelNode when merging 
child RelSet


--
[...truncated 111.09 KB...]
> Configure project :example:csv
Evaluating project ':example:csv' using build file 
'

> Configure project :example:function
Evaluating project ':example:function' using build file 
'
All projects evaluated.
Selected primary task 'publish' from project :
file or directory 
'
 not found
file or directory 
'
 not found
file or directory 
'
 not found
file or directory 
'
 not found
Tasks to be executed: [task ':publish', task ':linq4j:compileJava', task 
':core:compileKotlin', task ':core:fmppMain', task ':core:javaCCMain', task 
':core:versionClass', task ':core:compileJava', task ':babel:compileKotlin', 
task ':babel:fmppMain', task ':babel:javaCCMain', task ':babel:compileJava', 
task ':babel:processResources', task ':babel:classes', task 
':babel:inspectClassesForKotlinIC', task ':babel:jar', task 
':babel:generateMetadataFileForBabelPublication', task 
':babel:generatePomFileForBabelPublication', task ':gitProps', task ':rat', 
task ':validateBeforeBuildingReleaseArtifacts', task 
':validateNexusCredentials', task ':initializeNexusStagingRepository', task 
':babel:initializeNexusStagingRepository', task ':babel:javadoc', task 
':babel:javadocJar', task ':babel:sourcesJar', task 
':babel:publishBabelPublicationToNexusRepository', task ':babel:publish', task 
':cassandra:compileJava', task ':cassandra:processResources', task 
':cassandra:classes', task ':cassandra:jar', task 
':cassandra:generateMetadataFileForCassandraPublication', task 
':cassandra:generatePomFileForCassandraPublication', task 
':cassandra:initializeNexusStagingRepository', task ':cassandra:javadoc', task 
':cassandra:javadocJar', task ':cassandra:sourcesJar', task 
':cassandra:publishCassandraPublicationToNexusRepository', task 
':cassandra:publish', task ':core:processResources', task ':core:classes', task 
':core:inspectClassesForKotlinIC', task ':core:jar', task 
':core:generateMetadataFileForCorePublication', task 
':core:generatePomFileForCorePublication', task 
':core:initializeNexusStagingRepository', task ':core:javadoc', task 
':core:javadocJar', task ':core:sourcesJar', task ':core:compileTestKotlin', 
task ':core:fmppTest', task ':core:javaCCTest', task ':core:compileTestJava', 
task ':core:processTestResources', task ':core:testClasses', task 
':core:testJar', task ':core:publishCorePublicationToNexusRepository', task 
':core:publish', task ':druid:compileJava', task ':druid:processResources', 
task ':druid:classes', task ':druid:jar', task 
':druid:generateMetadataFileForDruidPublication', task 
':druid:generatePomFileForDruidPublication', task 
':druid:initializeNexusStagingRepository', task ':druid:javadoc', task 
':druid:javadocJar', task ':druid:sourcesJar', task 
':druid:publishDruidPublicationToNexusRepository', task ':druid:publish', task 
':elasticsearch:compileJava', task ':elasticsearch:processResources', task 
':elasticsearch:classes', task ':elasticsearch:jar', task 
':elasticsearch:generateMetadataFileForElasticsearchPublication', task 
':elasticsearch:generatePomFileForElasticsearchPublication', task 
':elasticsearch:initializeNexusStagingRepository', task 
':elasticsearch:javadoc', task ':elasticsearch:javadocJar', task 
':elasticsearch:sourcesJar', task 
':elasticsearch:publishElasticsearchPublicationToNexusRepository', task 
':elasticsearch:publish', task ':example:csv:compileJava', task 
':file:compileJava', task ':file:processResources', task ':file:classes', task 
':file:jar', task ':file:generateMetadataFileForFilePublication', task 
':file:generatePomFileForFilePublication', task 
':file:initializeNexusStagingRepository', task ':file:javadoc', task 
':file:javadocJar', task ':file:sourcesJar', task 
':file:publishFilePublicationToNexusRepository', task ':file:publish', task 
':geode:compileJava', task ':geode:processResources', task ':geode:classes', 
task ':geode:jar', task ':geode:generateMetadataFileForGeodePublication', task 
':geode:generatePomFileForGeodePublication', task 
':geode:initializeNexusStagingRepository', task ':geode:javadoc', task 
':geode:javadocJar', task ':geode:sourcesJar', task 
':geode:publishGeodePublicationToNexusRepository',