You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/06 13:12:39 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #3700: Fix `DataFrame::with_column` to handle creating column names with a period

alamb commented on code in PR #3700:
URL: https://github.com/apache/arrow-datafusion/pull/3700#discussion_r989032049


##########
datafusion/core/src/dataframe.rs:
##########
@@ -1378,6 +1383,43 @@ mod tests {
         Ok(())
     }
 
+    #[tokio::test]
+    async fn with_column_name() -> Result<()> {
+        // define data with a column name that has a "." in it:
+        let array: Int32Array = [1, 10].into_iter().collect();
+        let batch =
+            RecordBatch::try_from_iter(vec![("f.c1", Arc::new(array) as _)]).unwrap();
+
+        let ctx = SessionContext::new();
+        ctx.register_batch("t", batch).unwrap();
+
+        let df = ctx
+            .table("t")
+            .unwrap()
+            // try and create a column with a '.' in it
+            .with_column("f.c2", lit("hello"))
+            .unwrap();
+        // Note trying to select causes an error (todo file a separate ticket)

Review Comment:
   https://github.com/apache/arrow-datafusion/issues/3733



-- 
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