ydb-platform / ydb

YDB is an open source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions
https://ydb.tech
Apache License 2.0
4k stars 565 forks source link

Query service loses the request issues with warnings #6236

Closed alex268 closed 4 months ago

alex268 commented 4 months ago

I created a simple table CREATE TABLE test (id Int32, PRIMARY KEY(id)); and try to execute request SELECT * FROM test WHERE id IN [1, 2, 3]; If I execute it via the table service, I get a successful result with some warning issues:

operation {
  ready: true
  status: SUCCESS
  issues {
    message: "Type annotation"
    issue_code: 1030
    severity: 2
    issues {
      position { row: 1 column: 1 }
      message: "At function: RemovePrefixMembers, At function: RemoveSystemMembers, At function: PersistableRepr, At function: SqlProject"
      end_position { row: 1 column: 1 }
      severity: 2
      issues {
        position { row: 1 column: 15 }
        message: "At function: Filter, At function: Coalesce"
        end_position { row: 1 column: 15 }
        severity: 2
        issues {
          position { row: 1 column: 41 }
          message: "At function: SqlIn"
          end_position { row: 1 column: 41 }
          severity: 2
          issues {
            position { row: 1 column: 41 }
            message: "IN may produce unexpected result when used with nullable arguments. Consider adding \'PRAGMA AnsiInForEmptyOrNullableItemsCollections;\'"
            end_position { row: 1 column: 41 }
            issue_code: 1108
            severity: 2
          }
        }
      }
    }
  }
  result {
    type_url: "type.googleapis.com/Ydb.Table.ExecuteQueryResult"
    value: "..."
  }
}

But if I use the query service - I get only one message without issues

result_set {
  columns {
    name: "id"
    type {
      optional_type {
        item {
          type_id: INT32
        }
      }
    }
  }
}
tx_meta {
}
dcherednik commented 4 months ago

Actually issues is passing in case of SUCCESS. I added test to it https://github.com/ydb-platform/ydb/pull/6258

It looks like the query "SELECT * FROM test WHERE id IN [1, 2, 3]" is not producing warning at all in the query service. I am not sure is it an issue or not...

alex268 commented 4 months ago

Closed as not confirmed