xudong963 commented on a change in pull request #1914:
URL: https://github.com/apache/arrow-datafusion/pull/1914#discussion_r820351594
##########
File path: datafusion-common/src/dfschema.rs
##########
@@ -36,16 +36,30 @@ pub type DFSchemaRef = Arc<DFSchema>;
pub struct DFSchema {
/// Fields
fields: Vec<DFField>,
+ /// Additional metadata in form of key value pairs
+ metadata: HashMap<String, String>,
}
impl DFSchema {
/// Creates an empty `DFSchema`
pub fn empty() -> Self {
- Self { fields: vec![] }
+ Self {
+ fields: vec![],
+ metadata: HashMap::new(),
+ }
}
+ #[deprecated(since = "7.0.0", note = "please use `new_with_metadata`
instead")]
/// Create a new `DFSchema`
pub fn new(fields: Vec<DFField>) -> Result<Self> {
+ Self::new_with_metadata(fields, HashMap::new())
+ }
+
+ /// Create a new `DFSchema`
+ pub fn new_with_metadata(
Review comment:
IMO, metadata in DFSchema is a new feature in the next release, if users
want to use it, they'll check the API doc. So we don't need to depend on the
compiler's warning.
--
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]