You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extended clickbench query (benchmarks/queries/clickbench/extended/q6.sql) plan is failed with the error:
Internal error: Expect TypeSignatureClass::Native(LogicalType(Native(String), String)) but received NativeType::Binary, DataType: BinaryView.
To Reproduce
Run datafusion-cli:
> CREATE EXTERNAL TABLE hits STORED AS PARQUET LOCATION "../benchmarks/data/hits_partitioned"
> SELECT COUNT(*) AS ShareCount FROM hits WHERE "IsMobile" = 1 AND "MobilePhoneModel" LIKE 'iPhone%' AND "SocialAction" = 'share' AND "SocialSourceNetworkID" IN (5, 12) AND "ClientTimeZone" BETWEEN -5 AND 5 AND regexp_match("Referer", '\/campaign\/(spring|summer)_promo') IS NOT NULL AND CASE WHEN split_part(split_part("URL", 'resolution=', 2), '&', 1) ~ '^\d+$' THEN split_part(split_part("URL", 'resolution=', 2), '&', 1)::INT ELSE 0 END > 1920 AND levenshtein(CAST("UTMSource" AS STRING), CAST("UTMCampaign" AS STRING)) < 3;
type_coercion
caused by
Internal error: Expect TypeSignatureClass::Native(LogicalType(Native(String), String)) but received NativeType::Binary, DataType: BinaryView.
This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues
$
> create table t (b bytea);
> select count(*) from t where split_part(b, 'resolution=', 2)::INT > 0;
type_coercion
caused by
Internal error: Expect TypeSignatureClass::Native(LogicalType(Native(String), String)) but received NativeType::Binary, DataType: Binary.
This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues
andrewlamb@Andrews-MacBook-Pro-3:~/Software/datafusion$ cargo bench --profile=dev --bench sql_planner -- q50
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.20s
Running benches/sql_planner.rs (target/debug/deps/sql_planner-5e0f5af2fea8f56d)
Gnuplot not found, using plotters backend
Benchmarking physical_plan_clickbench_q50: Warming up for 3.0000 s
thread 'main' (38326073) panicked at datafusion/core/benches/sql_planner.rs:62:14:
called `Result::unwrap()` on an `Err` value: Context("type_coercion", Internal("Expect TypeSignatureClass::Native(LogicalType(Native(String), String)) but received NativeType::Binary, DataType: BinaryView"))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: bench failed, to rerun pass `-p datafusion --bench sql_planner`
Activity
askalt commentedon Jan 14, 2026
Reduced example:
[-]type coercion error on clickbench50 query[/-][+]type coercion error in clickbench50 query[/+]lemorage commentedon Jan 14, 2026
take
askalt commentedon Jan 14, 2026
It seems,
binary_as_stringconfiguration fixes:Because
SplitPartFuncexplicitly wants string:The question is: "why did it even work at one time without this setting?". Investigated that it worked before refactoring
1ce4b51
There was cast to utf-8 in the plan:
So maybe we should set this configuration by default for query-planner benchmark.
askalt commentedon Jan 14, 2026
Note: it causes query-planner benchmark fail:
#19792 (comment)
lemorage commentedon Jan 14, 2026
Maybe it would be better to add the implicit coercion in
SplitPartFunc::new()there?askalt commentedon Jan 14, 2026
Sounds good to me.
alamb commentedon Jan 15, 2026
BTW you can reproduce the problem using
cargo benchas wellUse correct setting for click bench queries in sql_planner benchmark (#…
Improve error message when string functions receive Binary types (#19819
Use correct setting for click bench queries in sql_planner benchmark (a…
Improve error message when string functions receive Binary types (apa…