ARROW-5419: [C++] Allow recognizing empty strings as null strings in CSV files

This commit is contained in:
Antoine Pitrou committed 2019-05-27 17:03:34 +02:00
1 parent f82af62dfd
commit cb086d1c25
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
benchmark
benchmark=1.4.1
boost-cpp>=1.68.0
brotli
bzip2
+2 -2
View File
@@ -130,7 +130,7 @@ TEST(BinaryConversion, Nulls) {
options.strings_can_be_null = true;
AssertConversion<BinaryType, std::string>(binary(), {"ab,N/A\n", "NULL,\n"},
{{"ab", ""}, {"", ""}},
{{true, false}, {false, true}}, options);
{{true, false}, {false, false}}, options);
}
TEST(StringConversion, Basics) {
@@ -152,7 +152,7 @@ TEST(StringConversion, Nulls) {
options.strings_can_be_null = true;
AssertConversion<StringType, std::string>(utf8(), {"ab,N/A\n", "NULL,\n"},
{{"ab", ""}, {"", ""}},
{{true, false}, {false, true}}, options);
{{true, false}, {false, false}}, options);
}
TEST(StringConversion, Errors) {
+1 -1
View File
@@ -144,7 +144,7 @@ class VarSizeBinaryConverter : public ConcreteConverter {
if (options_.strings_can_be_null) {
auto visit = [&](const uint8_t* data, uint32_t size, bool quoted) -> Status {
if (size > 0 && IsNull(data, size, false /* quoted */)) {
if (IsNull(data, size, false /* quoted */)) {
builder.UnsafeAppendNull();
return Status::OK();
} else {