Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4724

In JDBC adapter for ClickHouse, implement Values by generating SELECT without FROM

    XMLWordPrintableJSON

Details

    Description

      In JDBC adapter for ClickHouse, implement Values by generating SELECT without FROM. In ClickHouseSqlDialect, the supportsAliasedValues() method should return false.

      We use ClickHouseSqlDialect to do some sql optimize.  For sql select 1, in the process of sqlNode → relNode → sqlNode, the sql string will be transformed to 

      SELECT *
      FROM (VALUES (1)) AS `t` (`EXPR$0`)
      

      Since clickhouse is not support AliasedValues, all we need to do is to extend ClickHouseSqlDialect and make `supportsAliasedValues` return false. 

      Maybe this kind of behavior can integrated into core? 

      If needed, the pull request is ready.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Enze Enze Liu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m