Merge pull request #34961 from Avogar/fix-schema-inference

Fix wrong schema inference for unquoted dates in CSV
This commit is contained in:
Kruglov Pavel 2022-03-02 18:06:52 +03:00 committed by GitHub
commit 3e17f6dd4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -262,7 +262,7 @@ static bool evaluateConstantExpressionFromString(const StringRef & field, DataTy
/// FIXME: Our parser cannot parse maps in the form of '{key : value}' that is used in text formats.
bool parsed = parser.parse(token_iterator, ast, expected);
if (!parsed)
if (!parsed || !token_iterator->isEnd())
return false;
try

View File

@ -0,0 +1 @@
c1 Nullable(String)

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
echo "2020-02-01 16:00:00" | $CLICKHOUSE_LOCAL -q "desc table table" --input-format "CSV" --file=-