[jira] [Created] (CALCITE-5782) Add TO_HEX and FROM_HEX functions (enabled in BigQuery library)

2023-06-14 Thread Dan Zou (Jira)
Dan Zou created CALCITE-5782:


 Summary: Add TO_HEX and FROM_HEX functions (enabled in BigQuery 
library)
 Key: CALCITE-5782
 URL: https://issues.apache.org/jira/browse/CALCITE-5782
 Project: Calcite
  Issue Type: New Feature
Reporter: Dan Zou
Assignee: Dan Zou


Add TO_HEX and FROM_HEX functions (enabled in BigQuery library)
* TO_HEX: Converts a sequence of {{BYTES}} into a hexadecimal {{{}STRING{}}}. 
* FROM_HEX: Converts a hexadecimal-encoded {{STRING}} into {{BYTES}} format

See more details in BigQuery doc 
[TO_HEX|https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#to_hex],
 
[FROM_HEX|https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#from_hex]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-5777) Simplify 'OperandTypes.STRING.or(OperandTypes.BINARY)' to 'OperandTypes.STRING'

2023-06-13 Thread Dan Zou (Jira)
Dan Zou created CALCITE-5777:


 Summary: Simplify 'OperandTypes.STRING.or(OperandTypes.BINARY)' to 
'OperandTypes.STRING'
 Key: CALCITE-5777
 URL: https://issues.apache.org/jira/browse/CALCITE-5777
 Project: Calcite
  Issue Type: Bug
Reporter: Dan Zou


We have used 'OperandTypes.STRING.or(OperandTypes.BINARY)' multiple times as 
the SqlOperandTypeChecker in 'SqlLibraryOperators'. But this is not reasonable, 
as the STRING family already contains BINARY family, which means we could 
simplify 'OperandTypes.STRING.or(OperandTypes.BINARY)' to 'OperandTypes.STRING'.

{code:java}
  // From 'SqlTypeName'
  public static final List STRING_TYPES =
  combine(CHAR_TYPES, BINARY_TYPES);
{code}




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-5770) Implement SAFE_SUBTRACT function (enabled for BigQuery)

2023-06-07 Thread Dan Zou (Jira)
Dan Zou created CALCITE-5770:


 Summary: Implement SAFE_SUBTRACT function (enabled for BigQuery)
 Key: CALCITE-5770
 URL: https://issues.apache.org/jira/browse/CALCITE-5770
 Project: Calcite
  Issue Type: Sub-task
Reporter: Dan Zou


Add support for SAFE_SUBTRACT in BigQuery.
SAFE_ADD: Equivalent to the addition operator '-', but returns NULL if overflow 
occurs.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-5729) Add BYTE_LENGTH function (enabled in BigQuery library)

2023-05-28 Thread Dan Zou (Jira)
Dan Zou created CALCITE-5729:


 Summary: Add BYTE_LENGTH function (enabled in BigQuery library)
 Key: CALCITE-5729
 URL: https://issues.apache.org/jira/browse/CALCITE-5729
 Project: Calcite
  Issue Type: New Feature
Reporter: Dan Zou
Assignee: Dan Zou


BYTE_LENGTH(value): Returns the length of the STRING or BYTES value in BYTES, 
regardless of whether the type of the value is STRING or BYTES.

For more details: 
[BYTE_LENGTH|https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#byte_length]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-5728) Add ARRAY_TO_STRING function (enabled in BigQuery library)

2023-05-28 Thread Dan Zou (Jira)
Dan Zou created CALCITE-5728:


 Summary: Add ARRAY_TO_STRING function (enabled in BigQuery library)
 Key: CALCITE-5728
 URL: https://issues.apache.org/jira/browse/CALCITE-5728
 Project: Calcite
  Issue Type: New Feature
Reporter: Dan Zou
Assignee: Dan Zou


ARRAY_TO_STRING: Returns a concatenation of the elements in array_expression as 
a STRING.
For more details: 
[ARRAY_TO_STRING|https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#array_to_string]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-5709) Add TO_BASE32 and FROM_BASE32 functions (enabled in BigQuery library)

2023-05-18 Thread Dan Zou (Jira)
Dan Zou created CALCITE-5709:


 Summary: Add TO_BASE32 and FROM_BASE32 functions (enabled in 
BigQuery library)
 Key: CALCITE-5709
 URL: https://issues.apache.org/jira/browse/CALCITE-5709
 Project: Calcite
  Issue Type: New Feature
Reporter: Dan Zou


- TO_BASE32(bytes_expr): Converts a sequence of BYTES into a base32-encoded 
STRING.
- FROM_BASE32(string_expr): Converts the base32-encoded input string_expr into 
BYTES format.

See more details in BigQuery doc: 
[TO_BASE32|https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#to_base32]
 and 
[FROM_BASE32|https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#from_base32]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-5642) Add SHA256, SHA512 functions

2023-04-12 Thread Dan Zou (Jira)
Dan Zou created CALCITE-5642:


 Summary: Add SHA256, SHA512 functions
 Key: CALCITE-5642
 URL: https://issues.apache.org/jira/browse/CALCITE-5642
 Project: Calcite
  Issue Type: New Feature
Reporter: Dan Zou


Add SHA256, SHA512 functions and enable them for BigQuery.

SHA256: Computes the hash of the input using the [SHA-256 
algorithm|https://en.wikipedia.org/wiki/SHA-2]. This function returns 32 bytes.

SHA512: Computes the hash of the input using the [SHA-512 
algorithm|https://en.wikipedia.org/wiki/SHA-2]. This function returns 64 bytes.

See more details in [BigQuery 
Doc|https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#sha256]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-5640) Implement SAFE_ADD function

2023-04-11 Thread Dan Zou (Jira)
Dan Zou created CALCITE-5640:


 Summary: Implement SAFE_ADD function
 Key: CALCITE-5640
 URL: https://issues.apache.org/jira/browse/CALCITE-5640
 Project: Calcite
  Issue Type: Sub-task
Reporter: Dan Zou
Assignee: Dan Zou


Add support for SAFE_ADD in BigQuery.
*SAFE_ADD*: Equivalent to the addition operator '+', but returns NULL if 
overflow occurs.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-5608) Implement ACOSH function

2023-03-23 Thread Dan Zou (Jira)
Dan Zou created CALCITE-5608:


 Summary: Implement ACOSH function
 Key: CALCITE-5608
 URL: https://issues.apache.org/jira/browse/CALCITE-5608
 Project: Calcite
  Issue Type: Sub-task
Reporter: Dan Zou


ACOSH(X): Computes the inverse hyperbolic cosine of X.
See more details in [BigQuery 
DOC|https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#acosh]
h4.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-5606) Add SqlLibrary.ALL and change the library of TANH, COSH, SINH to it

2023-03-23 Thread Dan Zou (Jira)
Dan Zou created CALCITE-5606:


 Summary: Add SqlLibrary.ALL and change the library of TANH, COSH, 
SINH to it
 Key: CALCITE-5606
 URL: https://issues.apache.org/jira/browse/CALCITE-5606
 Project: Calcite
  Issue Type: Sub-task
Reporter: Dan Zou
Assignee: Dan Zou


Add a new SqlLibrary named 'ALL' with abbreviation '*', if an operator is 
marked with this SqlLibrary, it means it's a common one and should belong to 
all the library. TANH, COSH, SINH are three of these operators.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)