TheBuilderJR opened a new issue, #13624:
URL: https://github.com/apache/datafusion/issues/13624

   ### Describe the bug
   
   This code used to work in v40 but now doesn't in v43
   
   ```
   let mut writer = LineDelimitedWriter::new(Cursor::new(&mut buf));
                   writer
                       .write_batches(&[&batch])
                       .map_err(|e| anyhow!("Failed to write record batch to 
JSON: {:?}", e))?;
   ```
   
   Printing out the schema, it looks like timestamp, which was previously 
considered a UTF8 is no considered a UTF8 view
   
   ```
       schema: Schema {
           fields: [
               Field {
                   name: "heartbeat",
                   data_type: Boolean,
                   nullable: true,
                   dict_id: 0,
                   dict_is_ordered: false,
                   metadata: {},
               },
               Field {
                   name: "timestamp",
                   data_type: Utf8View,
                   nullable: true,
                   dict_id: 0,
                   dict_is_ordered: false,
                   metadata: {},
               },
               Field {
                   name: "timestamp_utc",
                   data_type: Timestamp(
                       Millisecond,
                       Some(
                           "UTC",
                       ),
                   ),
                   nullable: true,
                   dict_id: 0,
                   dict_is_ordered: false,
                   metadata: {},
               },
           ],
           metadata: {},
       },
   ```
   
   This causes apache arrow to throw:
   
   ```
   Failed to write record batch to JSON: InvalidArgumentError("JSON Writer does 
not support data type: Utf8View")
   ```
   
   ### To Reproduce
   
   ```
   let mut writer = LineDelimitedWriter::new(Cursor::new(&mut buf));
                   writer
                       .write_batches(&[&batch])
                       .map_err(|e| anyhow!("Failed to write record batch to 
JSON: {:?}", e))?;
   ```
   
   where a batch is what a datafusion query returns that includes a Utf8View
   
   ### Expected behavior
   
   No errors
   
   ### Additional context
   
   _No response_


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to