Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-28601

CBAS RQG for Arithmetic functions: Mentioned cbas queries have different result in comparison to SQL.

    XMLWordPrintable

Details

    • Untriaged
    • Unknown

    Description

      sql_query :: SELECT bool_field1 FROM simple_table WHERE ( ( decimal_field1 >= TRUNCATE( 1000 * LOG( 5071 ), 0 ) ) ) AND ( ( NOT ( bool_field1 ) ) ) ORDER BY char_field1
      cbas_query :: SELECT bool_field1 FROM simple_table_db_84091977_simple_table WHERE ( ( decimal_field1 >= TRUNC( 1000 * LOG( 5071 ), 0 ) ) ) AND ( ( NOT ( bool_field1 ) ) ) ORDER BY char_field1

      =========================================================

      sql_query :: SELECT varchar_field1 FROM simple_table WHERE ( ( bool_field1 ) ) AND ( ( decimal_field1 >= TRUNCATE( 1000 * LN( 5071 ), 0 ) ) ) OR ( ( NOT ( bool_field1 ) ) ) AND ( ( decimal_field1 > TRUNCATE( 1000 * ACOS( 5071 ), 0 ) ) ) ORDER BY int_field1
      cbas_query :: SELECT varchar_field1 FROM simple_table_db_84091977_simple_table WHERE ( ( bool_field1 ) ) AND ( ( decimal_field1 >= TRUNC( 1000 * LN( 5071 ), 0 ) ) ) OR ( ( NOT ( bool_field1 ) ) ) AND ( ( decimal_field1 > TRUNC( 1000 * ACOS( 5071 ), 0 ) ) ) ORDER BY int_field1

      =========================================================

      sql_query :: SELECT DISTINCT( primary_key_id ) FROM simple_table WHERE ( ( varchar_field1 <= SUBSTR( "ZBqhMErfuR", 1 ) ) ) AND ( NOT ( ( NOT (decimal_field1 >= TRUNCATE( 1000 * ASIN( 5071 ), 0 )) ) ) ) OR ( NOT ( NOT ( ( bool_field1 = true ) ) ) ) AND ( ( varchar_field1 IN ( "AAzaaKLuoS" , "ABlcYEhyhK" , "ADRnwiUKxf" , "ALPGArgccj" , "APzAeWkBhu" ) ) ) ORDER BY bool_field1
      cbas_query :: SELECT DISTINCT( primary_key_id ) FROM simple_table_db_84091977_simple_table WHERE ( ( varchar_field1 <= SUBSTR( "ZBqhMErfuR", 0 ) ) ) AND ( NOT ( ( NOT (decimal_field1 >= TRUNC( 1000 * ASIN( 5071 ), 0 )) ) ) ) OR ( NOT ( NOT ( ( bool_field1 = true ) ) ) ) AND ( ( varchar_field1 IN [ "AAzaaKLuoS" , "ABlcYEhyhK" , "ADRnwiUKxf" , "ALPGArgccj" , "APzAeWkBhu" ] ) ) ORDER BY bool_field1

      =========================================================

      sql_query :: SELECT * FROM simple_table WHERE ( ( int_field1 >= TRUNCATE( 1000 * ASIN( 47941685 ), 0 ) ) ) OR ( ( varchar_field1 < RTRIM( "ZBqhMErfuR" ) ) ) ORDER BY bool_field1
      cbas_query :: SELECT * FROM simple_table_db_84091977_simple_table WHERE ( ( int_field1 >= TRUNC( 1000 * ASIN( 47941685 ), 0 ) ) ) OR ( ( varchar_field1 < RTRIM( "ZBqhMErfuR" ) ) ) ORDER BY bool_field1

      =========================================================

      sql_query :: SELECT DISTINCT( char_field1 ) FROM simple_table WHERE ( ( primary_key_id < SUBSTR( "549", 1 ) ) ) AND ( ( NOT (decimal_field1 < TRUNCATE( 1000 * ACOS( 5071 ), 0 )) ) ) OR ( ( bool_field1 ) ) AND ( ( char_field1 LIKE '%N%' ) ) ORDER BY bool_field1
      cbas_query :: SELECT DISTINCT( char_field1 ) FROM simple_table_db_84091977_simple_table WHERE ( ( primary_key_id < SUBSTR( "549", 0 ) ) ) AND ( ( NOT (decimal_field1 < TRUNC( 1000 * ACOS( 5071 ), 0 )) ) ) OR ( ( bool_field1 ) ) AND ( ( char_field1 LIKE '%N%' ) ) ORDER BY bool_field1

      =========================================================

      sql_query :: SELECT * FROM simple_table WHERE ( ( NOT ( varchar_field1 > LTRIM( "ZBqhMErfuR" ) ) ) ) AND ( ( bool_field1 = true ) ) OR ( ( decimal_field1 != TRUNCATE( 1000 * ACOS( 5071 ), 0 ) ) ) AND ( ( ( char_field1 IN ( "A" , "B" , "C" , "D" , "E" ) ) AND ( primary_key_id NOT LIKE "549" ) ) ) ORDER BY char_field1
      cbas_query :: SELECT * FROM simple_table_db_84091977_simple_table WHERE ( ( NOT ( varchar_field1 > LTRIM( "ZBqhMErfuR" ) ) ) ) AND ( ( bool_field1 = true ) ) OR ( ( decimal_field1 != TRUNC( 1000 * ACOS( 5071 ), 0 ) ) ) AND ( ( ( char_field1 IN [ "A" , "B" , "C" , "D" , "E" ] ) AND ( primary_key_id NOT LIKE "549" ) ) ) ORDER BY char_field1

      =========================================================

      sql_query :: SELECT DISTINCT( bool_field1 ) FROM simple_table WHERE ( ( bool_field1 ) ) AND ( ( NOT (NOT (decimal_field1 >= TRUNCATE( 1000 * ASIN( 5071 ), 0 ))) ) ) OR ( ( char_field1 IN ( "A" , "B" , "C" , "D" , "E" ) ) ) AND ( ( bool_field1 != true ) ) ORDER BY decimal_field1
      cbas_query :: SELECT DISTINCT( bool_field1 ) FROM simple_table_db_84091977_simple_table WHERE ( ( bool_field1 ) ) AND ( ( NOT (NOT (decimal_field1 >= TRUNC( 1000 * ASIN( 5071 ), 0 ))) ) ) OR ( ( char_field1 IN [ "A" , "B" , "C" , "D" , "E" ] ) ) AND ( ( bool_field1 != true ) ) ORDER BY decimal_field1

      =========================================================

      sql_query :: SELECT * FROM simple_table WHERE ( ( ( varchar_field1 NOT BETWEEN "AAzaaKLuoS" and "zwDIxgKAOl" ) ) OR ( ( ( char_field1 IN ( "A" , "B" , "C" , "D" , "E" ) ) ) AND ( ( int_field1 != TRUNCATE( 1000 * ASIN( 47941685 ), 0 ) ) ) ) ) AND ( NOT ( NOT ( ( bool_field1 ) ) ) ) ORDER BY decimal_field1
      cbas_query :: SELECT * FROM simple_table_db_84091977_simple_table WHERE ( ( ( varchar_field1 NOT BETWEEN "AAzaaKLuoS" and "zwDIxgKAOl" ) ) OR ( ( ( char_field1 IN [ "A" , "B" , "C" , "D" , "E" ] ) ) AND ( ( int_field1 != TRUNC( 1000 * ASIN( 47941685 ), 0 ) ) ) ) ) AND ( NOT ( NOT ( ( bool_field1 ) ) ) ) ORDER BY decimal_field1

      =========================================================

      sql_query :: SELECT * FROM simple_table WHERE NOT ( NOT ( ( ( NOT ( bool_field1 ) ) ) AND ( NOT ( ( decimal_field1 > TRUNCATE( 1000 * LOG( 5071 ), 0 ) ) ) ) ) ) ORDER BY bool_field1
      cbas_query :: SELECT * FROM simple_table_db_84091977_simple_table WHERE NOT ( NOT ( ( ( NOT ( bool_field1 ) ) ) AND ( NOT ( ( decimal_field1 > TRUNC( 1000 * LOG( 5071 ), 0 ) ) ) ) ) ) ORDER BY bool_field1

      =========================================================

      sql_query :: SELECT DISTINCT( bool_field1 ) FROM simple_table WHERE NOT ( ( decimal_field1 <= TRUNCATE( 1000 * ACOS( 5071 ), 0 ) ) ) ORDER BY int_field1
      cbas_query :: SELECT DISTINCT( bool_field1 ) FROM simple_table_db_84091977_simple_table WHERE NOT ( ( decimal_field1 <= TRUNC( 1000 * ACOS( 5071 ), 0 ) ) ) ORDER BY int_field1

      =========================================================

      sql_query :: SELECT bool_field1 FROM simple_table WHERE ( NOT ( NOT ( NOT ( ( primary_key_id >= REPLACE( "549" , "d" , "c" ) ) ) ) ) ) AND ( ( decimal_field1 < TRUNCATE( 1000 * LOG( 5071 ), 0 ) ) ) ORDER BY int_field1
      cbas_query :: SELECT bool_field1 FROM simple_table_db_84091977_simple_table WHERE ( NOT ( NOT ( NOT ( ( primary_key_id >= REPLACE( "549" , "d" , "c" ) ) ) ) ) ) AND ( ( decimal_field1 < TRUNC( 1000 * LOG( 5071 ), 0 ) ) ) ORDER BY int_field1

      Attachments

        1. data.json
          291 kB
        2. backup.zip
          69 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          Ritesh Agarwal I think that we should validate that a) Query and Analytics return the same result and b) run the comparison test accordingly (i.e. not based on the SQL result).

          till Till Westmann added a comment - Ritesh Agarwal I think that we should validate that a) Query and Analytics return the same result and b) run the comparison test accordingly (i.e. not based on the SQL result).

          Currently (build 6.0.0-1355)

          select value [ASIN(47941685), ACOS(47941685), ATAN(47941685)]
          

          returns

          [ "NaN", "NaN", 1.5707963059362222 ]
          

          for both the Query and Analytics services. This should be the expected result for both services.

          Do you agree, Keshav Murthy?

          till Till Westmann added a comment - Currently (build 6.0.0-1355) select value [ASIN(47941685), ACOS(47941685), ATAN(47941685)] returns [ "NaN", "NaN", 1.5707963059362222 ] for both the Query and Analytics services. This should be the expected result for both services. Do you agree, Keshav Murthy ?

          Yes.  I agree.

          keshav Keshav Murthy added a comment - Yes.  I agree.

          The current result is the expected result for the Query and Analytics services.

          till Till Westmann added a comment - The current result is the expected result for the Query and Analytics services.

          Bulk closing defects with resolution = user error, cannot reproduce, duplicate etc.

          mihir.kamdar Mihir Kamdar (Inactive) added a comment - Bulk closing defects with resolution = user error, cannot reproduce, duplicate etc.

          People

            ritesh.agarwal Ritesh Agarwal
            ritesh.agarwal Ritesh Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty