You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVELOPER_GUIDE.rst
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,20 +215,19 @@ Java files are formatted using `Spotless <https://github.com/diffplug/spotless>`
215
215
New PPL Command Checklist
216
216
=========================
217
217
218
-
If you are working on contributing a new PPL command, please read this guide and review all items in the checklist are done before
219
-
code review. You also can leverage this checklist to guide how to add new PPL command.
218
+
If you are working on contributing a new PPL command, please read this guide and review all items in the checklist are done before code review. You also can leverage this checklist to guide how to add new PPL command.
220
219
221
220
Prerequisite
222
221
------------
223
222
224
-
|✅ Open an RFC issue describing the command:
225
-
- Specify the purpose and need for the new command
226
-
- Include syntax definition, usage and examples
227
-
- Outline implementation options if multiple approaches exist
223
+
|✅ Open an RFC issue before starting to code:
224
+
- Describe the purpose of the new command
225
+
- Include at least syntax definition, usage and examples
226
+
- Implementation options are welcome if you have multiple ways to implement it
228
227
229
228
|✅ Obtain PM review approval for the RFC:
230
-
- Consult repository maintainers if PM is unavailable
231
-
- Be prepared for meetings to discuss syntax and usage details
229
+
- If PM unavailable, consult repository maintainers as alternative
230
+
- An offline meeting might be required to discuss the syntax and usage
232
231
233
232
Coding & Tests
234
233
--------------
@@ -282,15 +281,15 @@ Prerequisites
282
281
Developing User-Defined Functions (UDFs)
283
282
----------------------------------------
284
283
285
-
|✅ Creating UDFs: A user-defined function is an instance of ``SqlOperator`` that transforms input row expressions (``RexNode``) into a new one. There are three approaches to implementing UDFs:
284
+
|✅ Creating UDFs: A user-defined function is an instance of `SqlOperator <https://calcite.apache.org/javadocAggregate/org/apache/calcite/sql/SqlOperator.html>`_ that transforms input row expressions (`RexNode <https://calcite.apache.org/javadocAggregate/org/apache/calcite/rex/RexNode.html>`_) into a new one. There are three approaches to implementing UDFs:
286
285
287
-
- Use existing Calcite operators: Leverage operators already declared in Calcite's ``SqlStdOperatorTable`` or ``SqlLibraryOperators``, and defined in ``RexImpTable.java``
286
+
- Use existing Calcite operators: Leverage operators already declared in Calcite's `SqlStdOperatorTable<https://calcite.apache.org/javadocAggregate/org/apache/calcite/sql/fun/SqlStdOperatorTable.html>`_ or `SqlLibraryOperators<https://calcite.apache.org/javadocAggregate/org/apache/calcite/sql/fun/SqlLibraryOperators.html>`_, and defined in `RexImpTable.java<https://calcite.apache.org/javadocAggregate/org/apache/calcite/adapter/enumerable/RexImpTable.html>`_
288
287
- Adapt existing static methods: Convert Java static methods to UDFs using utility functions like ``UserDefinedFunctionUtils.adaptExprMethodToUDF``
289
288
- Implement from scratch
290
289
291
290
* Implement the ``ImplementorUDF`` interface
292
291
* Instantiate and convert it to a ``SqlOperator`` in ``PPLBuiltinOperators``
293
-
* For optimal UDF performance, implement any data-independent logic during the compilation phase instead of at runtime. Specifically, use ling4j expressions for these operations rather than internal static method calls, as expressions are evaluated during compilation.
292
+
* For optimal UDF performance, implement any data-independent logic during the compilation phase instead of at runtime. Specifically, use `linq4j expressions<https://calcite.apache.org/javadocAggregate/org/apache/calcite/linq4j/tree/Expression.html>`_ for these operations rather than internal static method calls, as expressions are evaluated during compilation.
294
293
295
294
|✅ Type Checking for UDFs
296
295
- Each ``SqlOperator`` provides an operand type checker via the ``getOperandTypeChecker`` method
0 commit comments