Re: register a custom udf

2023-03-20 Thread Guillaume Masse
Hi Dan, Yes, I want to add some udf defined in Spark. Initially, I had: SqlLibraryOperatorTableFactory.INSTANCE.getOperatorTable( SqlLibrary.STANDARD, SqlLibrary.SPARK ) but it looks like some functions are not available, in my case it was: * sha2 (not defined) * from_unixtime (not

Re: register a custom udf

2023-03-20 Thread Dan Zou
Hi Guillaume, are you using your own udf and some functions in SqlStdOperatorTable at the same time? If yes, SqlOperatorTables#chain is the right way to organize multiple SqlOperatorTable. Best, Dan Zou > 2023年3月21日 02:59,Guillaume Masse 写道: > > I found the solution here: >

Re: register a custom udf

2023-03-20 Thread Guillaume Masse
I found the solution here: https://stackoverflow.com/questions/58268828/apache-calcite-registering-udfs-for-use-in-relbuilder The idea is to use `SqlOperatorTables.of`` to register a list of SqlFunction then use `SqlOperatorTables.chain` to join it with `SqlStdOperatorTable.instance()` On Mon,

Re: register a custom udf

2023-03-20 Thread Guillaume Masse
ah this is Scala, it's a bit shorter to write On Mon, Mar 20, 2023 at 1:12 PM Julian Hyde wrote: > What language is this? > > > On Mar 20, 2023, at 9:01 AM, Guillaume Masse < > masse.guilla...@narrative.io> wrote: > > > > Hi All, > > > > How can we register a custom udf? I found some solutions

Re: register a custom udf

2023-03-20 Thread Julian Hyde
What language is this? > On Mar 20, 2023, at 9:01 AM, Guillaume Masse > wrote: > > Hi All, > > How can we register a custom udf? I found some solutions on Stackoverflow > but they are out of date ( > https://stackoverflow.com/questions/44147819/adding-a-user-defined-function-to-calcite > ) >

register a custom udf

2023-03-20 Thread Guillaume Masse
Hi All, How can we register a custom udf? I found some solutions on Stackoverflow but they are out of date ( https://stackoverflow.com/questions/44147819/adding-a-user-defined-function-to-calcite ) So far what I have: // top level class class CustomUdf { def foo(in: Double): Double = in + 1 }

[jira] [Created] (CALCITE-5597) Column that be order by should not be aggregate

2023-03-20 Thread Jiajun Xie (Jira)
Jiajun Xie created CALCITE-5597: --- Summary: Column that be order by should not be aggregate Key: CALCITE-5597 URL: https://issues.apache.org/jira/browse/CALCITE-5597 Project: Calcite Issue