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 2021/05/10 13:19:59 UTC

[GitHub] [arrow] lidavidm opened a new pull request #10284: ARROW-12083: [C++][Dataset] Use given column types when determining CSV fragment schema

lidavidm opened a new pull request #10284:
URL: https://github.com/apache/arrow/pull/10284


   This lets you specify the types of some columns without having to specify the full schema.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] pitrou closed pull request #10284: ARROW-12083: [C++][Dataset] Use given column types when determining CSV fragment schema

Posted by GitBox <gi...@apache.org>.
pitrou closed pull request #10284:
URL: https://github.com/apache/arrow/pull/10284


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] pitrou commented on a change in pull request #10284: ARROW-12083: [C++][Dataset] Use given column types when determining CSV fragment schema

Posted by GitBox <gi...@apache.org>.
pitrou commented on a change in pull request #10284:
URL: https://github.com/apache/arrow/pull/10284#discussion_r629428714



##########
File path: cpp/src/arrow/dataset/file_csv_test.cc
##########
@@ -223,6 +223,24 @@ N/A
   EXPECT_EQ(*actual, Schema({field("f64", float64())}));
 }
 
+TEST_P(TestCsvFileFormat, InspectWithCustomConvertOptions) {
+  // Regression test for ARROW-12083
+  auto source = GetFileSource(R"(actually_string
+1.0
+
+N/A
+2
+whoops)");
+  auto defaults = std::make_shared<CsvFragmentScanOptions>();
+  // Prevent type inference from seeing the string value
+  defaults->read_options.block_size = 20;
+  // Override the inferred type
+  defaults->convert_options.column_types["actually_string"] = utf8();

Review comment:
       Should we also test the behaviour without this option set?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] lidavidm commented on a change in pull request #10284: ARROW-12083: [C++][Dataset] Use given column types when determining CSV fragment schema

Posted by GitBox <gi...@apache.org>.
lidavidm commented on a change in pull request #10284:
URL: https://github.com/apache/arrow/pull/10284#discussion_r629433054



##########
File path: cpp/src/arrow/dataset/file_csv_test.cc
##########
@@ -223,6 +223,24 @@ N/A
   EXPECT_EQ(*actual, Schema({field("f64", float64())}));
 }
 
+TEST_P(TestCsvFileFormat, InspectWithCustomConvertOptions) {
+  // Regression test for ARROW-12083
+  auto source = GetFileSource(R"(actually_string
+1.0
+
+N/A
+2
+whoops)");
+  auto defaults = std::make_shared<CsvFragmentScanOptions>();
+  // Prevent type inference from seeing the string value
+  defaults->read_options.block_size = 20;
+  // Override the inferred type
+  defaults->convert_options.column_types["actually_string"] = utf8();

Review comment:
       Done. I also realized there was no need to fiddle with block_size, we can just check that by default it infers float64 and that with the option it infers string.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #10284: ARROW-12083: [C++][Dataset] Use given column types when determining CSV fragment schema

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #10284:
URL: https://github.com/apache/arrow/pull/10284#issuecomment-836690860


   https://issues.apache.org/jira/browse/ARROW-12083


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org