Skip to content

Commit 5588f47

Browse files
prashantgolashfacebook-github-bot
authored andcommitted
feat: Session property to control file size for presto writer (#27054)
Summary: Session property to control the file size for presto writers Reviewed By: spershin Differential Revision: D91361183
1 parent c012600 commit 5588f47

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

presto-docs/src/main/sphinx/connector/hive.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,18 @@ Property Name Description
236236

237237
.. _constructor: https://github.com/apache/hadoop/blob/02a9190af5f8264e25966a80c8f9ea9bb6677899/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java#L844-L875
238238

239+
Hive Session Properties
240+
-----------------------
241+
242+
======================================================== ============================================================ ============
243+
Property Name Description Default
244+
======================================================== ============================================================ ============
245+
``native_max_target_file_size`` Native Execution only. Maximum target file size. When a ``0B``
246+
file exceeds this size during writing, the writer will
247+
close the current file and start writing to a new file.
248+
Zero means no limit.
249+
======================================================== ============================================================ ============
250+
239251
Avro Configuration Properties
240252
-----------------------------
241253

presto-hive/src/main/java/com/facebook/presto/hive/HiveSessionProperties.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ public final class HiveSessionProperties
139139

140140
public static final String NATIVE_STATS_BASED_FILTER_REORDER_DISABLED = "native_stats_based_filter_reorder_disabled";
141141

142+
public static final String NATIVE_MAX_TARGET_FILE_SIZE = "native_max_target_file_size";
143+
142144
private final List<PropertyMetadata<?>> sessionProperties;
143145

144146
@Inject
@@ -676,7 +678,12 @@ public HiveSessionProperties(HiveClientConfig hiveClientConfig, OrcFileWriterCon
676678
NATIVE_STATS_BASED_FILTER_REORDER_DISABLED,
677679
"Native Execution only. Disable stats based filter reordering.",
678680
false,
679-
true));
681+
true),
682+
dataSizeSessionProperty(
683+
NATIVE_MAX_TARGET_FILE_SIZE,
684+
"Native Execution only. Maximum target file size. When a file exceeds this size during writing, the writer will close the current file and start writing to a new file. Zero means no limit.",
685+
new DataSize(0, DataSize.Unit.BYTE),
686+
false));
680687
}
681688

682689
public List<PropertyMetadata<?>> getSessionProperties()

0 commit comments

Comments
 (0)