MCPcopy Create free account
hub / github.com/apache/datafusion / generate_different_schema

Function generate_different_schema

datafusion/optimizer/src/optimizer.rs:558–572  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

556
557 #[test]
558 fn generate_different_schema() {
559 let opt = Optimizer::with_rules(vec![Arc::new(GetTableScanRule {})]);
560 let config = OptimizerContext::new().with_skip_failing_rules(false);
561 let plan = LogicalPlan::EmptyRelation(EmptyRelation {
562 produce_one_row: false,
563 schema: Arc::new(DFSchema::empty()),
564 });
565 let err = opt.optimize(plan, &config, &observe).unwrap_err();
566
567 // Simplify assert to check the error message contains the expected message
568 assert_contains!(
569 err.strip_backtrace(),
570 "Failed due to a difference in schemas: original schema: DFSchema"
571 );
572 }
573
574 #[test]
575 fn skip_generate_different_schema() {

Callers

nothing calls this directly

Calls 6

newFunction · 0.85
EmptyRelationClass · 0.85
unwrap_errMethod · 0.80
emptyFunction · 0.50
optimizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…