[
https://issues.apache.org/jira/browse/HIVE-24162?focusedWorklogId=484561&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-484561
]
ASF GitHub Bot logged work on HIVE-24162:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Sep/20 15:36
Start Date: 15/Sep/20 15:36
Worklog Time Spent: 10m
Work Description: klcopp commented on a change in pull request #1498:
URL: https://github.com/apache/hive/pull/1498#discussion_r488761512
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactionQueryBuilder.java
##########
@@ -543,18 +543,26 @@ private void addTblProperties(StringBuilder query, int
bucketingVersion) {
if (crud && minor && isBucketed) {
tblProperties.put("bucketing_version", String.valueOf(bucketingVersion));
}
- if (insertOnly && sourceTab != null) { // to avoid NPEs, skip this part if
sourceTab is null
- // Exclude all standard table properties.
- Set<String> excludes = getHiveMetastoreConstants();
- excludes.addAll(StatsSetupConst.TABLE_PARAMS_STATS_KEYS);
- for (Map.Entry<String, String> e : sourceTab.getParameters().entrySet())
{
- if (e.getValue() == null) {
- continue;
+ if (sourceTab != null) { // to avoid NPEs, skip this part if sourceTab is
null
+ if (insertOnly) {
+ // Exclude all standard table properties.
+ Set<String> excludes = getHiveMetastoreConstants();
+ excludes.addAll(StatsSetupConst.TABLE_PARAMS_STATS_KEYS);
+ for (Map.Entry<String, String> e :
sourceTab.getParameters().entrySet()) {
+ if (e.getValue() == null) {
+ continue;
+ }
+ if (excludes.contains(e.getKey())) {
+ continue;
+ }
+ tblProperties.put(e.getKey(),
HiveStringUtils.escapeHiveCommand(e.getValue()));
}
- if (excludes.contains(e.getKey())) {
- continue;
+ } else if (crud) {
Review comment:
Nit: Just an "else" works
##########
File path:
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorOnTezTest.java
##########
@@ -144,11 +149,11 @@ void createMmTable(String tblName, boolean isPartitioned,
boolean isBucketed, St
void createMmTable(String dbName, String tblName, boolean isPartitioned,
boolean isBucketed, String fileFormat)
throws Exception {
- createTable(dbName, tblName, isPartitioned, isBucketed, true,
fileFormat);
+ createTable(dbName, tblName, isPartitioned, isBucketed, true,
fileFormat, false);
}
private void createTable(String dbName, String tblName, boolean
isPartitioned, boolean isBucketed,
- boolean insertOnly, String fileFormat) throws Exception {
+ boolean insertOnly, String fileFormat, boolean addBloomFilter) throws
Exception {
Review comment:
Nit: maybe add a param for additional tblproperties instead of a
boolean, for easier reading and more flexibility
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactionQueryBuilder.java
##########
@@ -543,18 +543,26 @@ private void addTblProperties(StringBuilder query, int
bucketingVersion) {
if (crud && minor && isBucketed) {
tblProperties.put("bucketing_version", String.valueOf(bucketingVersion));
}
- if (insertOnly && sourceTab != null) { // to avoid NPEs, skip this part if
sourceTab is null
- // Exclude all standard table properties.
- Set<String> excludes = getHiveMetastoreConstants();
- excludes.addAll(StatsSetupConst.TABLE_PARAMS_STATS_KEYS);
- for (Map.Entry<String, String> e : sourceTab.getParameters().entrySet())
{
- if (e.getValue() == null) {
- continue;
+ if (sourceTab != null) { // to avoid NPEs, skip this part if sourceTab is
null
+ if (insertOnly) {
+ // Exclude all standard table properties.
+ Set<String> excludes = getHiveMetastoreConstants();
+ excludes.addAll(StatsSetupConst.TABLE_PARAMS_STATS_KEYS);
+ for (Map.Entry<String, String> e :
sourceTab.getParameters().entrySet()) {
+ if (e.getValue() == null) {
+ continue;
+ }
+ if (excludes.contains(e.getKey())) {
+ continue;
+ }
+ tblProperties.put(e.getKey(),
HiveStringUtils.escapeHiveCommand(e.getValue()));
}
- if (excludes.contains(e.getKey())) {
- continue;
+ } else if (crud) {
+ for (Map.Entry<String, String> e :
sourceTab.getParameters().entrySet()) {
+ if (e.getKey().startsWith("orc.")) {
Review comment:
Just thinking, are there more properties that need to be included in the
compacted file, besides orc properties? Maybe not...
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 484561)
Time Spent: 0.5h (was: 20m)
> Query based compaction looses bloom filter
> ------------------------------------------
>
> Key: HIVE-24162
> URL: https://issues.apache.org/jira/browse/HIVE-24162
> Project: Hive
> Issue Type: Bug
> Reporter: Peter Varga
> Assignee: Peter Varga
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> *Steps to reproduce:*
>
> {noformat}
> +----------------------------------------------------+
> | createtab_stmt |
> +----------------------------------------------------+
> | CREATE TABLE `bloomTest`( |
> | `msisdn` string, |
> | `imsi` varchar(20), |
> | `imei` bigint, |
> | `cell_id` bigint) |
> | ROW FORMAT SERDE |
> | 'org.apache.hadoop.hive.ql.io.orc.OrcSerde' |
> | STORED AS INPUTFORMAT |
> | 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat' |
> | OUTPUTFORMAT |
> | 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat' |
> | LOCATION |
> |
> 's3a://dwxtpcds30-wwgq-dwx-managed/clusters/env-6cwwgq/warehouse-1580338415-7dph/warehouse/tablespace/managed/hive/del_db.db/bloomtest'
> |
> | TBLPROPERTIES ( |
> | 'bucketing_version'='2', |
> | 'orc.bloom.filter.columns'='msisdn,cell_id,imsi', |
> | 'orc.bloom.filter.fpp'='0.02', |
> | 'transactional'='true', |
> | 'transactional_properties'='default', |
> | 'transient_lastDdlTime'='1597222946') |
> +----------------------------------------------------+
> insert into bloomTest values ("a", "b", 10, 20);
> insert into bloomTest values ("aa", "bb", 100, 200);
> insert into bloomTest values ("aaa", "bbb", 1000, 2000);
> select * from bloomTest;
> +-------------------+-----------------+-----------------+--------------------+
> | bloomtest.msisdn | bloomtest.imsi | bloomtest.imei | bloomtest.cell_id |
> +-------------------+-----------------+-----------------+--------------------+
> | a | b | 10 | 20 |
> | aa | bb | 100 | 200 |
> | aaa | bbb | 1000 | 2000 |
> +-------------------+-----------------+-----------------+--------------------+
> {noformat}
> - Compact the table
> {code:java}
> alter table bloomTest compact 'MAJOR';
> {code}
> - Wait for the compaction to be over and check for bloom filters in dataset.
>
> - delta would have it, but not in the base dataset.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)