Skip to content
Merged
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 @@ -84,7 +84,7 @@
import static java.lang.Math.min;
import static java.util.Objects.requireNonNull;

class GenericHiveRecordCursor<K, V extends Writable>
public class GenericHiveRecordCursor<K, V extends Writable>
implements RecordCursor
{
private static final DateTimeZone JVM_TIME_ZONE = DateTimeZone.getDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import com.facebook.presto.hive.rcfile.RcFilePageSourceFactory;
import com.facebook.presto.hive.rule.HivePlanOptimizerProvider;
import com.facebook.presto.hive.s3.PrestoS3ClientFactory;
import com.facebook.presto.hive.s3select.S3SelectRecordCursorProvider;
import com.facebook.presto.orc.CachingStripeMetadataSource;
import com.facebook.presto.orc.DwrfAwareStripeMetadataSourceFactory;
import com.facebook.presto.orc.EncryptionLibrary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public static Optional<CompressionCodec> getCompressionCodec(TextInputFormat inp
return (Class<? extends InputFormat<?, ?>>) clazz.asSubclass(InputFormat.class);
}

static String getInputFormatName(Properties schema)
public static String getInputFormatName(Properties schema)
{
String name = schema.getProperty(FILE_INPUT_FORMAT);
checkCondition(name != null, HIVE_INVALID_METADATA, "Table or partition is missing Hive input format property: %s", FILE_INPUT_FORMAT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
import static com.facebook.presto.hive.NestedDirectoryPolicy.FAIL;
import static com.facebook.presto.hive.NestedDirectoryPolicy.IGNORED;
import static com.facebook.presto.hive.NestedDirectoryPolicy.RECURSE;
import static com.facebook.presto.hive.S3SelectPushdown.shouldEnablePushdownForTable;
import static com.facebook.presto.hive.metastore.MetastoreUtil.getHiveSchema;
import static com.facebook.presto.hive.metastore.MetastoreUtil.getPartitionLocation;
import static com.facebook.presto.hive.s3select.S3SelectPushdown.shouldEnablePushdownForTable;
import static com.facebook.presto.hive.util.ConfigurationUtils.toJobConf;
import static com.facebook.presto.spi.StandardErrorCode.NOT_SUPPORTED;
import static com.google.common.base.Preconditions.checkArgument;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.presto.hive;
package com.facebook.presto.hive.s3select;

import com.amazonaws.services.s3.model.CSVInput;
import com.amazonaws.services.s3.model.CSVOutput;
Expand All @@ -20,6 +20,7 @@
import com.amazonaws.services.s3.model.InputSerialization;
import com.amazonaws.services.s3.model.OutputSerialization;
import com.amazonaws.services.s3.model.SelectObjectContentRequest;
import com.facebook.presto.hive.HiveClientConfig;
import com.facebook.presto.hive.s3.PrestoS3ClientFactory;
import com.facebook.presto.hive.s3.PrestoS3FileSystem;
import com.facebook.presto.spi.PrestoException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.presto.hive;
package com.facebook.presto.hive.s3select;

import com.amazonaws.services.s3.model.AmazonS3Exception;
import com.amazonaws.services.s3.model.SelectObjectContentRequest;
import com.facebook.presto.hive.HiveClientConfig;
import com.facebook.presto.hive.s3.HiveS3Config;
import com.facebook.presto.hive.s3.PrestoS3ClientFactory;
import com.facebook.presto.hive.s3.PrestoS3SelectClient;
Expand Down Expand Up @@ -217,7 +218,7 @@ String getFieldDelimiter(Properties schema)
* For example, "Caused by: com.amazonaws.services.s3.model.AmazonS3Exception: Forbidden (Service: Amazon S3; Status Code: 403 ..."
*/
@VisibleForTesting
static class UnrecoverableS3OperationException
public static class UnrecoverableS3OperationException
extends RuntimeException
{
public UnrecoverableS3OperationException(String bucket, String key, Throwable cause)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.presto.hive;
package com.facebook.presto.hive.s3select;

import com.facebook.airlift.log.Logger;
import com.facebook.presto.hive.metastore.Column;
Expand Down Expand Up @@ -125,7 +125,7 @@ private static boolean isS3Storage(String path)
return SUPPORTED_S3_PREFIXES.stream().anyMatch(path::startsWith);
}

static boolean shouldEnablePushdownForTable(ConnectorSession session, Table table, String path, Optional<Partition> optionalPartition)
public static boolean shouldEnablePushdownForTable(ConnectorSession session, Table table, String path, Optional<Partition> optionalPartition)
{
if (!isS3SelectPushdownEnabled(session)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.presto.hive;
package com.facebook.presto.hive.s3select;

import com.facebook.presto.common.type.TypeManager;
import com.facebook.presto.hive.GenericHiveRecordCursor;
import com.facebook.presto.hive.HiveColumnHandle;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Writable;
Expand All @@ -35,7 +37,7 @@
import static org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMN_TYPES;
import static org.apache.hadoop.hive.serde.serdeConstants.SERIALIZATION_DDL;

class S3SelectRecordCursor<K, V extends Writable>
public class S3SelectRecordCursor<K, V extends Writable>
extends GenericHiveRecordCursor<K, V>
{
private static final String THRIFT_STRUCT = "struct";
Expand All @@ -59,7 +61,7 @@ public S3SelectRecordCursor(
// since s3select only returns the required column, not the whole columns
// we need to update the split schema to include only the required columns
// otherwise, Serde could not deserialize output from s3select to row data correctly
static Properties updateSplitSchema(Properties splitSchema, List<HiveColumnHandle> columns)
public static Properties updateSplitSchema(Properties splitSchema, List<HiveColumnHandle> columns)
{
requireNonNull(splitSchema, "splitSchema is null");
requireNonNull(columns, "columns is null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.presto.hive;
package com.facebook.presto.hive.s3select;

import com.facebook.presto.common.predicate.TupleDomain;
import com.facebook.presto.common.type.TypeManager;
import com.facebook.presto.hive.HdfsEnvironment;
import com.facebook.presto.hive.HiveClientConfig;
import com.facebook.presto.hive.HiveColumnHandle;
import com.facebook.presto.hive.HiveFileSplit;
import com.facebook.presto.hive.HiveRecordCursorProvider;
import com.facebook.presto.hive.IonSqlQueryBuilder;
import com.facebook.presto.hive.s3.PrestoS3ClientFactory;
import com.facebook.presto.spi.ConnectorSession;
import com.facebook.presto.spi.PrestoException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.facebook.presto.hive.HiveSplitPartitionInfo;
import com.facebook.presto.hive.InternalHiveSplit;
import com.facebook.presto.hive.InternalHiveSplit.InternalHiveBlock;
import com.facebook.presto.hive.S3SelectPushdown;
import com.facebook.presto.hive.s3select.S3SelectPushdown;
import com.facebook.presto.spi.HostAddress;
import com.facebook.presto.spi.schedule.NodeSelectionStrategy;
import com.google.common.collect.ImmutableList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.presto.hive;
package com.facebook.presto.hive.s3select;

import org.testng.annotations.Test;

import java.io.IOException;

import static com.facebook.presto.hive.S3SelectLineRecordReader.UnrecoverableS3OperationException;
import static com.facebook.presto.hive.s3select.S3SelectLineRecordReader.UnrecoverableS3OperationException;

public class TestS3SelectLineRecordReader
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.presto.hive;
package com.facebook.presto.hive.s3select;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapred.JobConf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.presto.hive;
package com.facebook.presto.hive.s3select;

import com.facebook.presto.common.type.StandardTypes;
import com.facebook.presto.common.type.TestingTypeManager;
import com.facebook.presto.common.type.TypeManager;
import com.facebook.presto.hive.HiveColumnHandle;
import com.facebook.presto.hive.HiveType;
import com.google.common.collect.ImmutableList;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
Expand All @@ -34,7 +36,7 @@
import static com.facebook.presto.hive.HiveColumnHandle.ColumnType.REGULAR;
import static com.facebook.presto.hive.HiveType.HIVE_INT;
import static com.facebook.presto.hive.HiveType.HIVE_STRING;
import static com.facebook.presto.hive.S3SelectRecordCursor.updateSplitSchema;
import static com.facebook.presto.hive.s3select.S3SelectRecordCursor.updateSplitSchema;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static java.util.stream.Collectors.joining;
Expand Down