[jira] [Created] (CALCITE-4369) COUNTIF support for BigQuery

2020-10-30 Thread Aryeh Hillman (Jira)
Aryeh Hillman created CALCITE-4369:
--

 Summary: COUNTIF support for BigQuery
 Key: CALCITE-4369
 URL: https://issues.apache.org/jira/browse/CALCITE-4369
 Project: Calcite
  Issue Type: Bug
Reporter: Aryeh Hillman


Example:

{{select countif(x > 0) from (select 1 as x, 2 as y, 3 as z)}}



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


[jira] [Created] (CALCITE-3933) Incorrect SQL Emitted for Unicode for Several Dialects

2020-04-16 Thread Aryeh Hillman (Jira)
Aryeh Hillman created CALCITE-3933:
--

 Summary: Incorrect SQL Emitted for Unicode for Several Dialects
 Key: CALCITE-3933
 URL: https://issues.apache.org/jira/browse/CALCITE-3933
 Project: Calcite
  Issue Type: Bug
 Environment: master with latest commit on April 15 (

dfb842e55e1fa7037c8a731341010ed1c0cfb6f7)
Reporter: Aryeh Hillman


A string literal like "schön" should emit "schön" in SQL for most dialects 
(BigQuery, MySQL, Redshift and a few others), but instead emits 
"u&'sch\\00f6n'" (ISO-8859-1 ASCII).  It's possible that some dialects may 
support ISO-8859, but in my tests with BigQuery Standard SQL, MySQL, and 
Redshift engines, "select u&'sch\\00f6n';` fails but "select 'schön';` succeeds.

Test that demonstrates (add to 
`org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java` and run from there):
{code:java}
@Test void testBigQueryUnicode() {
  final Function relFn = b ->
  b.scan("EMP")
  .filter(
  b.call(SqlStdOperatorTable.IN, b.field("ENAME"),
  b.literal("schön")))
  .build();
  final String expectedSql = "SELECT *\n"
  + "FROM \"scott\".\"EMP\"\n"
  + "WHERE \"ENAME\" IN ('schön')";
  relFn(relFn).withBigQuery().ok(expectedSql);
}
{code}
  



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