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

Caican Cai updated CALCITE-6668:
--------------------------------
    Description: 
Arrow adapter should support IS FALSE Operator and IS TRUE Operator

Here is a simple example
{code:java}
    String sql = "select \"booleanField\"\n"
        + "from arrowdatatype\n"
        + "where \"booleanField\" is true";
{code}
Its plan can be optimized to

{code:java}
    String plan = "PLAN=ArrowToEnumerableConverter\n"
        + "  ArrowProject(booleanField=[$7])\n"
        + "    ArrowFilter(condition=[$7])\n"
        + "      ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 
2, 3, 4, 5, 6, 7, 8, 9]])\n\n";
{code}


  was:
The filter in the current code does not support the Is_false Operator and 
Is_true Operator
{code:java}
    case EQUALS:
      return translateBinary("equal", "=", (RexCall) node);
    case NOT_EQUALS:
      return translateBinary("not_equal", "<>", (RexCall) node);
    case LESS_THAN:
      return translateBinary("less_than", ">", (RexCall) node);
    case LESS_THAN_OR_EQUAL:
      return translateBinary("less_than_or_equal_to", ">=", (RexCall) node);
    case GREATER_THAN:
      return translateBinary("greater_than", "<", (RexCall) node);
    case GREATER_THAN_OR_EQUAL:
      return translateBinary("greater_than_or_equal_to", "<=", (RexCall) node);
    case IS_NULL:
      return translateUnary("isnull", (RexCall) node);
    case IS_NOT_NULL:
      return translateUnary("isnotnull", (RexCall) node);
{code}


        Summary: Arrow adapter should support IS FALSE Operator and IS TRUE 
Operator  (was: Support Is_false Operator and Is_true Operator in Arrow adapter)

> Arrow adapter should support IS FALSE Operator and IS TRUE Operator
> -------------------------------------------------------------------
>
>                 Key: CALCITE-6668
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6668
>             Project: Calcite
>          Issue Type: Bug
>          Components: arrow-adapter
>    Affects Versions: 1.38.0
>            Reporter: Caican Cai
>            Assignee: Caican Cai
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.39.0
>
>
> Arrow adapter should support IS FALSE Operator and IS TRUE Operator
> Here is a simple example
> {code:java}
>     String sql = "select \"booleanField\"\n"
>         + "from arrowdatatype\n"
>         + "where \"booleanField\" is true";
> {code}
> Its plan can be optimized to
> {code:java}
>     String plan = "PLAN=ArrowToEnumerableConverter\n"
>         + "  ArrowProject(booleanField=[$7])\n"
>         + "    ArrowFilter(condition=[$7])\n"
>         + "      ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 
> 1, 2, 3, 4, 5, 6, 7, 8, 9]])\n\n";
> {code}



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

Reply via email to