Re: [Discussion] How to get the table alias in RelNode tree or TableScan?

2023-08-16 Thread Julian Hyde
You can’t get the alias. In RelNode-land there is no such concept. Just the inputs to the current RelNode, identified by ordinal. Maybe at the time of SQL-to-RelNode conversion you can convert the aliases in the hint into ordinals. That’s the last moment that aliases are available. Julian >

[Discussion] How to get the table alias in RelNode tree or TableScan?

2023-08-16 Thread LakeShen
Hi Community, Currently I'm working on Calcite SQL Hint,and I want to know how to get the table alias in al RelNode tree. For example,consider the following sql : select /*+ BROADCAST(a,b) */ * from nation as a left join nation as b on a.N_REGIONKEY = b.N_REGIONKEY The hint BROADCAST(a,b) indic

[jira] [Created] (CALCITE-5933) Add SAFE_DIVIDE function (enabled in BigQuery library)

2023-08-16 Thread Tanner Clary (Jira)
Tanner Clary created CALCITE-5933: - Summary: Add SAFE_DIVIDE function (enabled in BigQuery library) Key: CALCITE-5933 URL: https://issues.apache.org/jira/browse/CALCITE-5933 Project: Calcite

[jira] [Created] (CALCITE-5932) Add SAFE_SUBTRACT function (enabled in BigQuery library)

2023-08-16 Thread Tanner Clary (Jira)
Tanner Clary created CALCITE-5932: - Summary: Add SAFE_SUBTRACT function (enabled in BigQuery library) Key: CALCITE-5932 URL: https://issues.apache.org/jira/browse/CALCITE-5932 Project: Calcite

Re: A link in the code has expired

2023-08-16 Thread Michael Mior
Thanks for pointing this out! It looks like Julian might have a mirror of that page at the link below that could be swapped out. Unfortunately, with the original page unavailable, I can't confirm. http://www.hydromatic.net/wiki/RelationalExpressionMetadata -- Michael Mior mm...@apache.org On We

Re: RE: Implementing HASH(*)

2023-08-16 Thread Kian Nassre
Also I had a few more follow up questions, if you have the availability to respond: - Is it `RelToSqlConverter` or `SqlToRelConverter` where the changes need to be made? - I already have the `HASH` function working in its non-star format (e.g. `HASH(A, B, C)` or `HASH(X)`). Would using `FUNCTION_ST

RE: RE: Implementing HASH(*)

2023-08-16 Thread Kian Nassre
Hello Hongyu Guo, Interesting! I’ll definitely explore this as an option. I’m curious though, do the convertlet tables in RelToSqlConverter have access to enough information to be able to look at a call to HASH(*) and derive the table names (+ their column names) corresponding the scope? My un

A link in the code has expired

2023-08-16 Thread Hongyu Guo
Hello, I found a link in RelMetadataProvider.java has expired. The link is http://wiki.eigenbase.org/RelationalExpressionMetadata Found in https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataProvider.java Best, Hongyu Guo

RE: Implementing HASH(*)

2023-08-16 Thread Hongyu Guo
Hi Kian Nassre, I try to create a HASH function instance to solve this problem ``` public static final SqlFunction HASH = new SqlFunction("HASH", SqlKind.OTHER_FUNCTION, ReturnTypes.BIGINT, null, OperandTypes.ONE_OR_MORE, SqlFunctionCategory.NUMERIC) { @Override public Sql

[jira] [Created] (CALCITE-5931) Fix integral number detection

2023-08-16 Thread Claude Brisson (Jira)
Claude Brisson created CALCITE-5931: --- Summary: Fix integral number detection Key: CALCITE-5931 URL: https://issues.apache.org/jira/browse/CALCITE-5931 Project: Calcite Issue Type: Bug