You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "WenyXu (via GitHub)" <gi...@apache.org> on 2023/04/14 04:23:56 UTC

[GitHub] [arrow-datafusion] WenyXu opened a new pull request, #6004: chore: make JsonOpener and CsvOpener public

WenyXu opened a new pull request, #6004:
URL: https://github.com/apache/arrow-datafusion/pull/6004

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   
   
   # Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   make `JsonOpener` and `CsvOpener` public
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


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


[GitHub] [arrow-datafusion] waynexia merged pull request #6004: chore: make JsonOpener and CsvOpener public

Posted by "waynexia (via GitHub)" <gi...@apache.org>.
waynexia merged PR #6004:
URL: https://github.com/apache/arrow-datafusion/pull/6004


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


[GitHub] [arrow-datafusion] waynexia commented on a diff in pull request #6004: chore: make JsonOpener and CsvOpener public

Posted by "waynexia (via GitHub)" <gi...@apache.org>.
waynexia commented on code in PR #6004:
URL: https://github.com/apache/arrow-datafusion/pull/6004#discussion_r1167505070


##########
datafusion-examples/examples/json_opener.rs:
##########
@@ -0,0 +1,94 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::{sync::Arc, vec};
+
+use arrow_schema::{DataType, Field, Schema};
+use datafusion::{
+    assert_batches_eq,
+    datasource::{
+        file_format::file_type::FileCompressionType, listing::PartitionedFile,
+        object_store::ObjectStoreUrl,
+    },
+    error::Result,
+    physical_plan::{
+        file_format::{FileScanConfig, FileStream, JsonOpener},
+        metrics::ExecutionPlanMetricsSet,
+    },
+};
+use futures::StreamExt;
+use object_store::ObjectStore;
+
+/// This example demonstrates a scanning against an Arrow data source (JSON) and
+/// fetching results
+#[tokio::main]
+async fn main() -> Result<()> {
+    let object_store = object_store::memory::InMemory::new();
+    let path = object_store::path::Path::from("demo.json");
+    let data = bytes::Bytes::from(
+        r#"{"num":5,"str":"test"}
+    {"num":2,"str":"hello"}
+    {"num":4,"str":"foo"}"#,

Review Comment:
   nit:
   ```suggestion
           {"num":2,"str":"hello"}
           {"num":4,"str":"foo"}"#,
   ```



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