You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "comphead (via GitHub)" <gi...@apache.org> on 2023/05/05 16:46:07 UTC

[GitHub] [arrow-datafusion] comphead commented on a diff in pull request #6254: fix: `projection_push_down` don't consider VarProvider in columns.

comphead commented on code in PR #6254:
URL: https://github.com/apache/arrow-datafusion/pull/6254#discussion_r1186303103


##########
datafusion/core/tests/dataframe.rs:
##########
@@ -1230,3 +1232,36 @@ pub async fn register_alltypes_tiny_pages_parquet(ctx: &SessionContext) -> Resul
     .await?;
     Ok(())
 }
+
+#[derive(Debug)]
+struct HardcodedIntProvider {}
+
+impl VarProvider for HardcodedIntProvider {
+    fn get_value(&self, _var_names: Vec<String>) -> Result<ScalarValue, DataFusionError> {
+        Ok(ScalarValue::Int64(Some(1234)))
+    }
+
+    fn get_type(&self, _: &[String]) -> Option<DataType> {
+        Some(DataType::Int64)
+    }
+}
+
+#[tokio::test]
+async fn use_var_provider() -> Result<()> {

Review Comment:
   ```
           let runtime = Arc::new(RuntimeEnv::default());
           let config = SessionConfig::new().with_target_partitions(4);
           let config = config.set_bool("datafusion.optimizer.skip_failed_rules", false);
           SessionState::with_config_rt(config, runtime)
           let ctx = SessionContext::with_config(config);
           let df = ctx.sql(sql) 
   
   ```
   ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org