From 5c86e60d3eb82e5a43c130e0350c6add69abfcb5 Mon Sep 17 00:00:00 2001 From: Dario Pizzamiglio Date: Thu, 28 Sep 2023 17:04:55 +0800 Subject: [PATCH] fix table name --- dozer-sql/src/pipeline_builder/from_builder.rs | 3 +++ dozer-sql/src/tests/builder_test.rs | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dozer-sql/src/pipeline_builder/from_builder.rs b/dozer-sql/src/pipeline_builder/from_builder.rs index 7cf1974e69..e14c63b7b9 100644 --- a/dozer-sql/src/pipeline_builder/from_builder.rs +++ b/dozer-sql/src/pipeline_builder/from_builder.rs @@ -361,6 +361,9 @@ pub fn is_table_operator( ) -> Result, PipelineError> { match relation { TableFactor::Table { name, args, .. } => { + if args.is_none() { + return Ok(None); + } let operator = get_table_operator_descriptor(name, args)?; Ok(operator) diff --git a/dozer-sql/src/tests/builder_test.rs b/dozer-sql/src/tests/builder_test.rs index 9242e0fdab..ec227a72e3 100644 --- a/dozer-sql/src/tests/builder_test.rs +++ b/dozer-sql/src/tests/builder_test.rs @@ -111,7 +111,7 @@ impl Source for TestSource { fw: &mut dyn SourceChannelForwarder, _last_checkpoint: SourceState, ) -> Result<(), BoxedError> { - for n in 0..10000 { + for n in 0..10 { fw.send( IngestionMessage::OperationEvent { table_index: 0, @@ -194,9 +194,9 @@ impl Sink for TestSink { async fn test_pipeline_builder() { let mut pipeline = AppPipeline::new_with_default_flags(); let context = statement_to_pipeline( - "SELECT Spending \ - FROM TTL(TUMBLE(users, timestamp, '5 MINUTES'), timestamp, '1 MINUTE') \ - WHERE Spending >= 1", + "SELECT t.Spending \ + FROM TTL(TUMBLE(users, timestamp, '5 MINUTES'), timestamp, '1 MINUTE') t JOIN users u on t.CustomerID=u.CustomerID \ + WHERE t.Spending >= 1", &mut pipeline, Some("results".to_string()), vec![],