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 14:57:51 UTC

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

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