Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.Properties;

import static org.apache.hadoop.hive.serde.serdeConstants.ESCAPE_CHAR;
import static org.apache.hadoop.hive.serde.serdeConstants.FIELD_DELIM;
import static org.apache.hadoop.hive.serde.serdeConstants.QUOTE_CHAR;

class S3SelectCsvRecordReader
Expand Down Expand Up @@ -91,4 +92,11 @@ public SelectObjectContentRequest buildSelectObjectRequest(Properties schema, St

return selectObjectRequest;
}

@Override
protected String getFieldDelimiter(Properties schema)
{
// Use the field delimiter only if it is specified in the schema. If not, use null (defaults to ',' in S3 Select).
return schema.getProperty(FIELD_DELIM);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public float getProgress()
return ((float) (position - start)) / (end - start);
}

String getFieldDelimiter(Properties schema)
protected String getFieldDelimiter(Properties schema)
{
return schema.getProperty(FIELD_DELIM, schema.getProperty(SERIALIZATION_FORMAT));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static boolean isCompressionCodecSupported(InputFormat<?, ?> inputFormat,
if (inputFormat instanceof TextInputFormat) {
return getCompressionCodec((TextInputFormat) inputFormat, path)
.map(codec -> (codec instanceof GzipCodec) || (codec instanceof BZip2Codec))
.orElse(false); // TODO (https://github.com/trinodb/trino/issues/2475) fix S3 Select when file not compressed
.orElse(true);
}

return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void setUp()
public void testIsCompressionCodecSupported()
{
assertTrue(S3SelectPushdown.isCompressionCodecSupported(inputFormat, new Path("s3://fakeBucket/fakeObject.gz")));
assertFalse(S3SelectPushdown.isCompressionCodecSupported(inputFormat, new Path("s3://fakeBucket/fakeObject")));
assertTrue(S3SelectPushdown.isCompressionCodecSupported(inputFormat, new Path("s3://fakeBucket/fakeObject")));
assertFalse(S3SelectPushdown.isCompressionCodecSupported(inputFormat, new Path("s3://fakeBucket/fakeObject.lz4")));
assertFalse(S3SelectPushdown.isCompressionCodecSupported(inputFormat, new Path("s3://fakeBucket/fakeObject.snappy")));
assertTrue(S3SelectPushdown.isCompressionCodecSupported(inputFormat, new Path("s3://fakeBucket/fakeObject.bz2")));
Expand Down