francis-du commented on a change in pull request #1054:
URL: https://github.com/apache/arrow-datafusion/pull/1054#discussion_r716220294
##########
File path: datafusion/tests/sql.rs
##########
@@ -2124,6 +2124,118 @@ async fn cross_join_unbalanced() {
);
}
+#[tokio::test]
+async fn test_join_float32() -> Result<()> {
+ let mut ctx = ExecutionContext::new();
+
+ // register population table
+ let population_schema = Arc::new(Schema::new(vec![
+ Field::new("city", DataType::Utf8, true),
+ Field::new("population", DataType::Float32, true),
+ ]));
+ let population_data = RecordBatch::try_new(
+ population_schema.clone(),
+ vec![
+ Arc::new(StringArray::from(vec![Some("a"), Some("b"), Some("c")])),
+ Arc::new(Float32Array::from(vec![838.698, 1778.934, 626.443])),
+ ],
+ )?;
+ let population_table =
+ MemTable::try_new(population_schema, vec![vec![population_data]])?;
+ ctx.register_table("population", Arc::new(population_table))?;
+
+ // register area table
+ let area_schema = Arc::new(Schema::new(vec![
+ Field::new("city", DataType::Utf8, true),
+ Field::new("area", DataType::Float32, true),
+ ]));
+ let area_data = RecordBatch::try_new(
+ area_schema.clone(),
+ vec![
+ Arc::new(StringArray::from(vec![Some("a"), Some("b"), Some("c")])),
+ Arc::new(Float32Array::from(vec![164.159, 143.352, 264.366])),
+ ],
+ )?;
+ let area_table = MemTable::try_new(area_schema, vec![vec![area_data]])?;
+ ctx.register_table("area", Arc::new(area_table))?;
+
+ let sql = "SELECT population.city, population.population, area.area \
+ FROM population \
+ JOIN (SELECT * FROM area) \
+ ON population.city = area.city \
Review comment:
Thank you for your reminder, I am going to modify it.
--
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]