diff --git a/src/sql/code_generator/ob_static_engine_cg.cpp b/src/sql/code_generator/ob_static_engine_cg.cpp index 597d3f6554..03d91ce5a8 100644 --- a/src/sql/code_generator/ob_static_engine_cg.cpp +++ b/src/sql/code_generator/ob_static_engine_cg.cpp @@ -380,6 +380,19 @@ int ObStaticEngineCG::postorder_generate_op(ObLogicalOperator &op, } } + if (OB_SUCC(ret) && log_op_def::LOG_TABLE_SCAN == op.get_type() + && static_cast(&op)->get_table_type() == share::schema::EXTERNAL_TABLE) { + ObDASScanCtDef &scan_ctdef = static_cast(spec)->tsc_ctdef_.scan_ctdef_; + ObExternalFileFormat::FormatType format_type = ObExternalFileFormat::INVALID_FORMAT; + if (OB_FAIL(ObSQLUtils::get_external_table_type(scan_ctdef.external_file_format_str_.str_, + format_type))) { + LOG_WARN("fail to get external table format", K(ret)); + } else if (ObExternalFileFormat::CSV_FORMAT != format_type && !spec->use_rich_format_) { + ret = OB_NOT_SUPPORTED; + LOG_USER_ERROR(OB_NOT_SUPPORTED, "Using non-rich vector format in external tables"); + } + } + return ret; }