Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5037

Couchbase UNION doesn't work correctly

XMLWordPrintable

      UNION operator is returning correct data.

      query_smalla
      SELECT IntKey, ShortValue FROM BQT1.SmallA WHERE ShortValue = -32745
      
      IntKey ShortValue
      23 -32745
      query_smallb
      SELECT IntKey, ShortValue FROM BQT2.SmallB WHERE ShortValue = -32750
      
      IntKey ShortValue
      18 -32750
      query_union
      SELECT IntKey, ShortValue FROM BQT1.SmallA WHERE ShortValue = -32745  UNION SELECT IntKey, ShortValue FROM BQT2.SmallB WHERE ShortValue = -32750
      
      IntKey ShortValue
      <null> -32750
      23 -32745
      teiid-command.log
      14:19:54,385 INFO  [org.teiid.COMMAND_LOG] (New I/O worker #3) nxUTZWzvm0Te     START USER COMMAND: startTime=2017-08-25 14:19:54.385       requestID=nxUTZWzvm0Te.9      txID=null sessionID=nxUTZWzvm0Te        applicationName=JDBC          principal=user@teiid-security vdbName=couchbase   vdbVersion=1        sql=SELECT IntKey, ShortValue FROM BQT1.SmallA WHERE ShortValue = -32745  UNION SELECT IntKey, ShortValue FROM BQT2.SmallB WHERE ShortValue = -32750
      14:19:54,389 DEBUG [org.teiid.COMMAND_LOG] (Worker78_QueryProcessorQueue660) nxUTZWzvm0Te           START DATA SRC COMMAND:       startTime=2017-08-25 14:19:54.389       requestID=nxUTZWzvm0Te.9      sourceCommandID=0   executionID=158     txID=null modelName=Couchbase_small     translatorName=couchbase      sessionID=nxUTZWzvm0Te        principal=user@teiid-security sql=SELECT Couchbase_small.SmallA.IntKey AS c_0, convert(Couchbase_small.SmallA.ShortValue, short) AS c_1 FROM Couchbase_small.SmallA WHERE convert(Couchbase_small.SmallA.ShortValue, short) = -32745 UNION SELECT Couchbase_small.SmallB.IntKey AS c_0, convert(Couchbase_small.SmallB.ShortValue, short) AS c_1 FROM Couchbase_small.SmallB WHERE convert(Couchbase_small.SmallB.ShortValue, short) = -32750 
      14:19:54,390 DEBUG [org.teiid.COMMAND_LOG] (Worker78_QueryProcessorQueue660) nxUTZWzvm0Te           SOURCE SRC COMMAND: endTime=2017-08-25 14:19:54.39          requestID=nxUTZWzvm0Te.9      sourceCommandID=0   executionID=158     txID=null modelName=Couchbase_small     translatorName=couchbase      sessionID=nxUTZWzvm0Te        principal=user@teiid-security sourceCommand=[SELECT `$cb_c1_IntKey`, TONUMBER(`$cb_c2_ShortValue`) FROM `dvqe_small` `$cb_t1` LET `$cb_c1_IntKey` = `$cb_t1`.`IntKey`, `$cb_c2_ShortValue` = `$cb_t1`.`ShortValue` WHERE TONUMBER(`$cb_c2_ShortValue`) = -32745 AND `$cb_t1`.`type` = 'SmallA' UNION SELECT `$cb_c3_IntKey`, TONUMBER(`$cb_c2_ShortValue`) FROM `dvqe_small` `$cb_t2` LET `$cb_c1_IntKey` = `$cb_t2`.`IntKey`, `$cb_c2_ShortValue` = `$cb_t2`.`ShortValue`, `$cb_c3_IntKey` = `$cb_t2`.`IntKey` WHERE TONUMBER(`$cb_c2_ShortValue`) = -32750 AND `$cb_t2`.`type` = 'SmallA']
      14:19:54,674 DEBUG [org.teiid.COMMAND_LOG] (Worker77_QueryProcessorQueue661) nxUTZWzvm0Te           END SRC COMMAND:    endTime=2017-08-25 14:19:54.674         requestID=nxUTZWzvm0Te.9      sourceCommandID=0   executionID=158     txID=null modelName=Couchbase_small     translatorName=couchbase      sessionID=nxUTZWzvm0Te        principal=user@teiid-security finalRowCount=2     cpuTime(ns)=1197365
      14:19:54,683 INFO  [org.teiid.COMMAND_LOG] (Worker77_QueryProcessorQueue662) nxUTZWzvm0Te           END USER COMMAND:   endTime=2017-08-25 14:19:54.683         requestID=nxUTZWzvm0Te.9      txID=null sessionID=nxUTZWzvm0Te        principal=user@teiid-security vdbName=couchbase   vdbVersion=1        finalRowCount=2
      

              rhn-engineering-shawkins Steven Hawkins
              jstastny@redhat.com Jan Stastny
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: