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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]