[jira] [Created] (CALCITE-3436) CalciteConnectionConfigImpl.set obliterates previous property values

2019-10-21 Thread Ryan Fu (Jira)
Ryan Fu created CALCITE-3436:


 Summary: CalciteConnectionConfigImpl.set obliterates previous 
property values
 Key: CALCITE-3436
 URL: https://issues.apache.org/jira/browse/CALCITE-3436
 Project: Calcite
  Issue Type: Bug
Reporter: Ryan Fu


The cause is that `new Properties(properties)` doesn't copy the previous value 
as, say, `new HashMap(map)` does.

 
 * Add a unit test in PlannerTest, that if you call set(x, 1) then set(y, 2) on 
a CalciteConnectionConfigImpl, the result contains x and y. 
 * Consider potentially using `clone()` as Properties implements Cloneable



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


[jira] [Updated] (CALCITE-3323) Handle arbitrary/unknown functions that have ordinary syntax

2019-09-19 Thread Ryan Fu (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-3323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Fu updated CALCITE-3323:
-
Description: 
Add a strategy where if a function has ordinary function syntax and we don't 
recognize it we assume that it can take any argument types and returns a result 
of unknown type.

We will still need to change the parser to handle functions with non-standard 
syntax (e.g. DATEADD). And it's a good idea to explicitly add commonly used 
non-standard functions (e.g. MD5, CONCAT).”


[19/Sept/2019] Functions have to have ordinary function syntax [e.g. foo(arg0, 
...)]. Current implementation idea is to:
 * Create a known/unknown flag for use within the validator
 * Create a more permissive SqlUnresolvedFunction to be passed through validator
 ** Allow OperandTypes to be variadic

  was:
Add a strategy where if a function has ordinary function syntax and we don't 
recognize it we assume that it can take any argument types and returns a result 
of unknown type.

We will still need to change the parser to handle functions with non-standard 
syntax (e.g. DATEADD). And it's a good idea to explicitly add commonly used 
non-standard functions (e.g. MD5, CONCAT).”


> Handle arbitrary/unknown functions that have ordinary syntax
> 
>
> Key: CALCITE-3323
> URL: https://issues.apache.org/jira/browse/CALCITE-3323
> Project: Calcite
>  Issue Type: New Feature
>Reporter: Ryan Fu
>Priority: Major
>
> Add a strategy where if a function has ordinary function syntax and we don't 
> recognize it we assume that it can take any argument types and returns a 
> result of unknown type.
> We will still need to change the parser to handle functions with non-standard 
> syntax (e.g. DATEADD). And it's a good idea to explicitly add commonly used 
> non-standard functions (e.g. MD5, CONCAT).”
> [19/Sept/2019] Functions have to have ordinary function syntax [e.g. 
> foo(arg0, ...)]. Current implementation idea is to:
>  * Create a known/unknown flag for use within the validator
>  * Create a more permissive SqlUnresolvedFunction to be passed through 
> validator
>  ** Allow OperandTypes to be variadic



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


[jira] [Created] (CALCITE-3323) Handle arbitrary/unknown functions that have ordinary syntax

2019-09-04 Thread Ryan Fu (Jira)
Ryan Fu created CALCITE-3323:


 Summary: Handle arbitrary/unknown functions that have ordinary 
syntax
 Key: CALCITE-3323
 URL: https://issues.apache.org/jira/browse/CALCITE-3323
 Project: Calcite
  Issue Type: New Feature
Reporter: Ryan Fu


Add a strategy where if a function has ordinary function syntax and we don't 
recognize it we assume that it can take any argument types and returns a result 
of unknown type.

We will still need to change the parser to handle functions with non-standard 
syntax (e.g. DATEADD). And it's a good idea to explicitly add commonly used 
non-standard functions (e.g. MD5, CONCAT).”



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (CALCITE-3280) Cannot parse query REGEXP_REPLACE in Redshift

2019-08-22 Thread Ryan Fu (Jira)


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

Ryan Fu commented on CALCITE-3280:
--

Hi [~lishuming], I was originally going to work on this but glad you were able 
to help contribute.

As for adding in variants of `REGEXP_REPLACE`, I would say it would be 
desirable but not necessary. One thing I would add in your pull request is a 
comment about your `LibraryOperator` to describe the functionality of 
`REGEXP_REPLACE`


{code:java}
/** The REGEXP_REPLACE(source_string, pattern, replacement) searches for a 
regular expression pattern and replaces every occurrence of the pattern with 
the specified string */
{code}

> Cannot parse query REGEXP_REPLACE in Redshift
> -
>
> Key: CALCITE-3280
> URL: https://issues.apache.org/jira/browse/CALCITE-3280
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Ryan Fu
>Priority: Minor
>  Labels: pull-request-available
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> REGEXP_REPLACE error:
> {code:}
> No match found for function signature REGEXP_REPLACE(, 
> , ){code}
>  
> Example query:
> {code:sql}
> SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
> '([[:space:]]|,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM 
> public.account {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Updated] (CALCITE-3280) Cannot parse query REGEXP_REPLACE in Redshift

2019-08-21 Thread Ryan Fu (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-3280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Fu updated CALCITE-3280:
-
Description: 
REGEXP_REPLACE error:
{code:}
No match found for function signature REGEXP_REPLACE(, , 
){code}
 

Example query:
{code:sql}
SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
'([[:space:]]|,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM public.account 
{code}

  was:
REGEXP_REPLACE error:
{code:java}
No match found for function signature REGEXP_REPLACE(, , 
){code}
 

Example query:
{code:java}
SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
'([[:space:]]|,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM public.account 
{code}


> Cannot parse query REGEXP_REPLACE in Redshift
> -
>
> Key: CALCITE-3280
> URL: https://issues.apache.org/jira/browse/CALCITE-3280
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Ryan Fu
>Priority: Minor
>
> REGEXP_REPLACE error:
> {code:}
> No match found for function signature REGEXP_REPLACE(, 
> , ){code}
>  
> Example query:
> {code:sql}
> SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
> '([[:space:]]|,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM 
> public.account {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Updated] (CALCITE-3280) Cannot parse query REGEXP_REPLACE in Redshift

2019-08-21 Thread Ryan Fu (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-3280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Fu updated CALCITE-3280:
-
Description: 
REGEXP_REPLACE error:
{code:java}
No match found for function signature REGEXP_REPLACE(, , 
){code}
 

Example query:
{code:java}
SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
'([[:space:]]|,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM public.account 
{code}

  was:
REGEXP_REPLACE error:
{code:java}
No match found for function signature REGEXP_REPLACE(, , 
){code}
 

Example query:

 
{code:java}
SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
'([[:space:]]|,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM public.account 
{code}


> Cannot parse query REGEXP_REPLACE in Redshift
> -
>
> Key: CALCITE-3280
> URL: https://issues.apache.org/jira/browse/CALCITE-3280
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Ryan Fu
>Priority: Minor
>
> REGEXP_REPLACE error:
> {code:java}
> No match found for function signature REGEXP_REPLACE(, 
> , ){code}
>  
> Example query:
> {code:java}
> SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
> '([[:space:]]|,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM 
> public.account {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Updated] (CALCITE-3280) Cannot parse query REGEXP_REPLACE in Redshift

2019-08-21 Thread Ryan Fu (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-3280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Fu updated CALCITE-3280:
-
Description: 
REGEXP_REPLACE error:
{code:java}
No match found for function signature REGEXP_REPLACE(, , 
){code}
 

Example query:

 
{code:java}
SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
'([[:space:]]|,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM public.account 
{code}

  was:
REGEXP_REPLACE error:

No match found for function signature REGEXP_REPLACE(, , 
)

 

Example query:

 
{code:java}
SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
'([[:space:]]|,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM public.account 
{code}


> Cannot parse query REGEXP_REPLACE in Redshift
> -
>
> Key: CALCITE-3280
> URL: https://issues.apache.org/jira/browse/CALCITE-3280
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Ryan Fu
>Priority: Minor
>
> REGEXP_REPLACE error:
> {code:java}
> No match found for function signature REGEXP_REPLACE(, 
> , ){code}
>  
> Example query:
>  
> {code:java}
> SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
> '([[:space:]]|,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM 
> public.account {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Updated] (CALCITE-3280) Cannot parse query REGEXP_REPLACE in Redshift

2019-08-21 Thread Ryan Fu (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-3280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Fu updated CALCITE-3280:
-
Description: 
REGEXP_REPLACE error:

No match found for function signature REGEXP_REPLACE(, , 
)

 

Example query:

 
{code:java}
SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
'([[:space:]]|,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM public.account 
{code}

  was:
REGEXP_REPLACE error:

No match found for function signature REGEXP_REPLACE(, , 
)

 

Example query:

 

{{}}
{code:java}

{code}
{{ SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
'([[:space:]]|\\,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM 
public.account}}

 


> Cannot parse query REGEXP_REPLACE in Redshift
> -
>
> Key: CALCITE-3280
> URL: https://issues.apache.org/jira/browse/CALCITE-3280
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Ryan Fu
>Priority: Minor
>
> REGEXP_REPLACE error:
> No match found for function signature REGEXP_REPLACE(, 
> , )
>  
> Example query:
>  
> {code:java}
> SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
> '([[:space:]]|,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM 
> public.account {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Created] (CALCITE-3280) Cannot parse query REGEXP_REPLACE in Redshift

2019-08-21 Thread Ryan Fu (Jira)
Ryan Fu created CALCITE-3280:


 Summary: Cannot parse query REGEXP_REPLACE in Redshift
 Key: CALCITE-3280
 URL: https://issues.apache.org/jira/browse/CALCITE-3280
 Project: Calcite
  Issue Type: Improvement
Reporter: Ryan Fu


REGEXP_REPLACE error:

No match found for function signature REGEXP_REPLACE(, , 
)

 

Example query:

 

{{}}
{code:java}

{code}
{{ SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
'([[:space:]]|\\,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM 
public.account}}

 



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (CALCITE-3235) Add CONCAT function for Redshift

2019-08-14 Thread Ryan Fu (JIRA)


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

Ryan Fu commented on CALCITE-3235:
--

PR: [https://github.com/apache/calcite/pull/1376] is ready for review

> Add CONCAT function for Redshift
> 
>
> Key: CALCITE-3235
> URL: https://issues.apache.org/jira/browse/CALCITE-3235
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Ryan Fu
>Priority: Minor
>  Labels: pull-request-available
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Get this error:
> {{No match found for function signature CONCAT(, , 
> ...)}}
> When using CONCAT, e.g.
> {{SELECT CONCAT('a', city) FROM public.aircraft}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Created] (CALCITE-3235) Add CONCAT function for Redshift

2019-08-07 Thread Ryan Fu (JIRA)
Ryan Fu created CALCITE-3235:


 Summary: Add CONCAT function for Redshift
 Key: CALCITE-3235
 URL: https://issues.apache.org/jira/browse/CALCITE-3235
 Project: Calcite
  Issue Type: Improvement
Reporter: Ryan Fu


Get this error:

{{No match found for function signature CONCAT(, )}}

When using CONCAT, e.g.

{{SELECT CONCAT('a', city) FROM public.aircraft}}

 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)