Skip to content

Commit 0e808e8

Browse files
fix for YQ-3632 (#8762)
1 parent b324f1b commit 0e808e8

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

ydb/core/external_sources/object_storage/inference/infer_config.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,21 @@ std::shared_ptr<FormatConfig> MakeJsonListConfig(const THashMap<TString, TString
4242
}
4343

4444
std::shared_ptr<FormatConfig> MakeFormatConfig(const THashMap<TString, TString>& params) {
45+
static THashSet<TString> supportedParams {
46+
"format",
47+
"compression",
48+
"filepattern",
49+
"partitionedby",
50+
"projection",
51+
"csvdelimiter",
52+
};
53+
54+
for (const auto& [param, value] : params) {
55+
if (!supportedParams.contains(param)) {
56+
throw yexception() << "parameter is not supported with type inference: " << param;
57+
}
58+
}
59+
4560
EFileFormat format;
4661
if (auto formatPtr = params.FindPtr("format"); formatPtr) {
4762
format = ConvertFileFormat(*formatPtr);

ydb/tests/fq/s3/test_s3_0.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,18 @@ def test_inference_timestamp(self, kikimr, s3, client, unique_prefix):
488488
assert result_set.columns[2].name == "c"
489489
assert result_set.columns[2].type.type_id == ydb.Type.UTF8
490490

491+
sql = f'''
492+
SELECT *
493+
FROM `{storage_connection_name}`.`timestamp.csv`
494+
WITH (format=csv_with_names, with_infer='true', `data.timestamp.formatname`='ISO');
495+
'''
496+
497+
query_id = client.create_query("simple", sql, type=fq.QueryContent.QueryType.ANALYTICS).result.query_id
498+
client.wait_query_status(query_id, fq.QueryMeta.FAILED)
499+
assert "parameter is not supported with type inference" in str(
500+
client.describe_query(query_id).result
501+
)
502+
491503
@yq_v2
492504
@pytest.mark.parametrize("client", [{"folder_id": "my_folder"}], indirect=True)
493505
def test_inference_projection(self, kikimr, s3, client, unique_prefix):

0 commit comments

Comments
 (0)