This is an automated email from the ASF dual-hosted git repository.
suxiaogang223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 8009ba5d798 [fix](fe) Allow VARBINARY table creation in external
catalogs (#71288)
8009ba5d798 is described below
commit 8009ba5d798c93629ce280111bb55851396b87f2
Author: Socrates <[email protected]>
AuthorDate: Thu Dec 3 14:57:34 2026 +0800
[fix](fe) Allow VARBINARY table creation in external catalogs (#71288)
### Background
CREATE TABLE and CTAS share column validation in CreateTableInfo.
Internal tables cannot store VARBINARY, while external connectors decide
which types their destinations support.
### What problem does this PR solve?
Issue Number: None
Related PR: None
PR Type: Bugfix
Problem Summary:
Common FE validation rejected VARBINARY columns for external catalogs
before their connectors could validate them. Restrict the rejection to
the internal catalog and remove the duplicate CTAS rejection. Extend the
existing Hive VARBINARY regression suite to cover both CREATE TABLE and
CTAS with a binary literal.
### Details
- **Frequency:** Every external CREATE TABLE or CTAS with a top-level
VARBINARY column.
- **Root cause:** Both common validation gates rejected VARBINARY
without checking the target catalog.
- **Why existing tests missed it:** External VARBINARY suites read and
write tables created by their fixtures, but did not create VARBINARY
tables through Doris.
- **Fix:** Keep the restriction in CreateTableInfo.validate for internal
targets and let CTAS reuse that validation.
- **Other paths and branches:** CREATE TABLE and CTAS are covered;
internal rejection and connector-specific type support remain intact.
This change targets master.
- **Behavior change:** External VARBINARY columns reach connector
validation instead of being rejected by fe-core.
### Testing
- Before the rebase, 39 existing FE tests passed locally across
CreateTableCommandTest, CreateTableInfoTest,
CreateTableInfoEngineCatalogTest, and VarBinaryLiteralParserTest, using
run-fe-ut.sh --run.
- The Hive VARBINARY suite passed Groovy 4.0.19 compilation before the
rebase; its source is unchanged.
- After the rebase, the complete CI command, cd fe && mvn clean
checkstyle:check, passed locally across all 93 modules with zero
Checkstyle violations. The GitHub Actions Code Style job, including Run
Java CheckStyle, also passed on the current PR head.
- TeamCity compile, FE UT, and external jobs passed on the previous PR
head. Runtime suites have not been rerun after this rebase, and the Hive
suite was not run locally.
### Notes for Reviewers
The previous FE CheckStyle job failed during Maven project parsing
because the base contained duplicate iceberg-core declarations. Rebase
onto current master inherits the upstream POM correction; the VARBINARY
patch is unchanged and adds no POM or workflow edits.
### Release note
External catalog CREATE TABLE and CTAS now allow VARBINARY columns
through common FE validation so connectors that support the type can
create them. Internal tables continue to reject VARBINARY, and
connector-specific type limitations still apply.
### Check List (For Author)
- Behavior changed: Yes (see Details)
- Does this need documentation: No
- Pre-submission status: Partially verified: full FE Checkstyle passed;
runtime suites have not been rerun after the rebase.
### AI Disclosure
- Tool: Codex (GPT-6)
- Generated: Code, regression coverage, and this description.
- Human review: not stated.
---
.../doris/nereids/trees/plans/commands/CreateTableCommand.java | 3 ---
.../doris/nereids/trees/plans/commands/info/CreateTableInfo.java | 3 ++-
.../external_table_p0/hive/test_hive_varbinary_type.groovy | 9 +++++++++
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/CreateTableCommand.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/CreateTableCommand.java
index 2eb2850e433..087f6bd2221 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/CreateTableCommand.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/CreateTableCommand.java
@@ -186,9 +186,6 @@ public class CreateTableCommand extends Command implements
NeedAuditEncryption,
if (dataType instanceof VariantType) {
dataType = ((VariantType) dataType).withoutPredefinedFields();
}
- if (dataType.isVarBinaryType()) {
- throw new AnalysisException("doris do not support varbinary
create table, could use it by catalog");
- }
if (i == 0 && dataType.isStringType()) {
// first column of olap table can not be string type.
// So change it to varchar type.
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java
index 27579e1981f..0f9251cbdf1 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java
@@ -489,7 +489,8 @@ public class CreateTableInfo {
throw new AnalysisException(
"Disable to create table column with name start with
__DORIS_: " + columnNameUpperCase);
}
- if (columnDef.getType().isVarBinaryType()) {
+ // External catalogs validate VARBINARY support in their
connectors.
+ if (targetIsInternalCatalog &&
columnDef.getType().isVarBinaryType()) {
throw new AnalysisException("doris do not support varbinary
create table, could use it by catalog");
}
if (columnDef.getType().isDateType() && Config.disable_datev1) {
diff --git
a/regression-test/suites/external_table_p0/hive/test_hive_varbinary_type.groovy
b/regression-test/suites/external_table_p0/hive/test_hive_varbinary_type.groovy
index b97f1020898..45230115744 100644
---
a/regression-test/suites/external_table_p0/hive/test_hive_varbinary_type.groovy
+++
b/regression-test/suites/external_table_p0/hive/test_hive_varbinary_type.groovy
@@ -50,6 +50,15 @@ suite("test_hive_varbinary_type", "p0,external") {
// The obsolete property cannot turn arbitrary binary bytes into UTF-8
strings.
sql """ switch ${catalog_name_no_mapping}"""
sql """ use `test_varbinary` """
+
+ // Both CREATE TABLE and CTAS must allow the Hive connector to handle
VARBINARY columns.
+ sql """ DROP TABLE IF EXISTS test_hive_varbinary_create """
+ sql """ CREATE TABLE test_hive_varbinary_create (id INT, b VARBINARY)
+ PROPERTIES ('file_format' = 'parquet') """
+ sql """ DROP TABLE IF EXISTS test_hive_varbinary_ctas """
+ sql """ CREATE TABLE test_hive_varbinary_ctas
+ PROPERTIES ('file_format' = 'parquet') AS SELECT 1 AS id,
X'ABCD' AS b """
+
qt_select1 """ select * from test_hive_binary_orc order by id; """
qt_select2 """ select * from test_hive_binary_parquet order by id; """
qt_select3 """ select * from test_hive_uuid_fixed_orc order by id; """
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]