[ 
https://issues.apache.org/jira/browse/CALCITE-3679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17102257#comment-17102257
 ] 

Ritesh commented on CALCITE-3679:
---------------------------------

Hi [~julianhyde]

_*Your comments are highly de-motivating.*_

First impression is that the PR is rather scruffy. Comments have been 
copy-pasted without being changed. Lines of whitespace have been added and 
removed. Some classes have no javadoc.

Justify why we need a new class of RexSlot.
_*{color:#172b4d}There is no new class RexSlot and If you referring to 
RexLambdaRef, I believe I have added comment in the PR itself.{color}*_

This case has no real description, so there's no indication of the intended 
scope. Do we intend to parse, validate, execute?
_*If the intended scope was not clear It could have been really nice that this 
should be pointed out in the beginning itself. Also I believe test cases are 
self explanatory of what this PR is solving. Might have missed few comments but 
thats what review is all about.*_

Lambdas in functional programming languages are functions-as-values. They are 
typed, they allow closures (carrying their environment for later evaluation) 
and they can be used anywhere that any other value is used. They are beautiful 
and very powerful. So a half-hearted implementation would make me very sad.
_*All I wanted is to contribute, I tried to implement lambda as function 
arguments, I asked for help alot many times to give me pointers to move ahead. 
After investing alot of time myself came up with some solution & want community 
to atleast review my approach.*_

The SQL implementations I have seen (Presto and SparkSQL) have a few built-in 
higher-order functions (i.e. functions that take lambdas as arguments and/or 
return lambdas as results) but do not allow user-defined higher-order 
functions. This makes me sad.

A minimal level of functionality for Calcite would include support for lambdas 
as standalone values (e.g. 'select empno, x -> x + 1 from emp') and adequate 
typing of lambdas (not 'LAMBDA' but 'FUNCTION<INTEGER, INTEGER>' or similar).

_*I have just started to contribute in this project and this was my first major 
feature which I worked on, I couldn't develop full blown lambda functionality 
without help. Releasing feature in phases is what I believe in.*_

 

_*I was just looking for guidance so that I could contribute.*_

> Allow lambda expressions in SQL queries
> ---------------------------------------
>
>                 Key: CALCITE-3679
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3679
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: Ritesh
>            Assignee: Ritesh
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: [CALCITE-3679]_Basic_implementation.patch
>
>          Time Spent: 5h 40m
>  Remaining Estimate: 0h
>
> [https://teradata.github.io/presto/docs/0.167-t/functions/lambda.html]



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

Reply via email to