Skip to content

Commit 64672e3

Browse files
committed
Handle Scheme error
1 parent f94e9e8 commit 64672e3

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

ydb/library/yql/providers/generic/connector/libcpp/error.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ namespace NYql::NConnector {
3737
return NDqProto::StatusIds::StatusCode::StatusIds_StatusCode_UNSUPPORTED;
3838
case ::Ydb::StatusIds::StatusCode::StatusIds_StatusCode_NOT_FOUND:
3939
return NDqProto::StatusIds::StatusCode::StatusIds_StatusCode_BAD_REQUEST;
40+
case ::Ydb::StatusIds::StatusCode::StatusIds_StatusCode_SCHEME_ERROR:
41+
return NDqProto::StatusIds::StatusCode::StatusIds_StatusCode_BAD_REQUEST;
4042
default:
43+
// FIXME: remove me after debug
44+
Cout << "CRAB: " << ::Ydb::StatusIds::StatusCode_Name(error.status()) << Endl;
4145
ythrow yexception() << "Unexpected YDB status code: " << ::Ydb::StatusIds::StatusCode_Name(error.status());
4246
}
4347
}

ydb/library/yql/providers/generic/provider/yql_generic_dq_integration.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,14 @@ namespace NYql {
269269
const auto& clusterConfig = State_->Configuration->ClusterNamesToClusterConfigs[clusterName];
270270
const auto& endpoint = clusterConfig.endpoint();
271271

272+
/*
272273
// for backward compability full path can be used (cluster_name.`db_name.table`)
273274
// TODO: simplify during https://st.yandex-team.ru/YQ-2494
274275
TStringBuf db, dbTable;
275276
if (!TStringBuf(table).TrySplit('.', db, dbTable)) {
276277
dbTable = table;
277278
}
279+
*/
278280

279281
YQL_CLOG(INFO, ProviderGeneric)
280282
<< "Filling lookup source settings"
@@ -288,7 +290,7 @@ namespace NYql {
288290
}
289291

290292
Generic::TLookupSource source;
291-
source.set_table(TString(dbTable));
293+
source.set_table(table);
292294
*source.mutable_data_source_instance() = tableMeta.value()->DataSourceInstance;
293295

294296
// Managed YDB supports access via IAM token.

ydb/library/yql/providers/generic/provider/yql_generic_load_meta.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ namespace NYql {
378378

379379
void FillTablePath(NConnector::NApi::TDescribeTableRequest& request, const TGenericClusterConfig& clusterConfig,
380380
const TString& tablePath) {
381+
/*
381382
// for backward compability full path can be used (cluster_name.`db_name.table`)
382383
// TODO: simplify during https://st.yandex-team.ru/YQ-2494
383384
const auto dataSourceKind = clusterConfig.GetKind();
@@ -410,6 +411,9 @@ namespace NYql {
410411
411412
request.mutable_data_source_instance()->set_database(TString(dbNameTarget));
412413
request.set_table(TString(tableName));
414+
*/
415+
request.mutable_data_source_instance()->set_database(clusterConfig.GetDatabaseName());
416+
request.set_table(tablePath);
413417
}
414418

415419
private:

0 commit comments

Comments
 (0)