impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Behm (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-2716: Hive/Impala incompatibility for timestamp data in Parquet
Date Sat, 11 Mar 2017 01:27:22 GMT
Alex Behm has posted comments on this change.

Change subject: IMPALA-2716: Hive/Impala incompatibility for timestamp data in Parquet

Patch Set 4:


Still need to look at tests. Code is getting close.
File be/src/exec/hdfs-scan-node-base.h:

Line 304:   // Time zone for adjusting timestamp values read from Parquet files written by
single line
File be/src/exec/

Line 246:           parent_->state_->LogError(ErrorMsg(TErrorCode::PARQUET_MR_WRITE_ZONE_INVALID,
I don't think logging an error is the right thing to do here. We will scan all files and just
keep appending to the error log, but no useful results can come of a query in this state.

This error is not recoverable, so I think we should terminate this scan and the query.

Consider moving this code into Reset() or better add a new Open() or Init() function that
is called once per column reader from HdfsParquetScanner::CreateColumnReaders(). That way
you can return a Status early and not scan any data.

Line 653:     } else {
As mentioned above, we should terminate the query early when in such a bad state. Imo, there
should be a DCHECK here.
File be/src/exprs/

Line 194:   for (const auto& tz_region: tz_region_list_) {
No need to use auto here. const string& is clearer
File be/src/exprs/timezone_db.h:

Line 40:   /// If 'tz' is not found in the database, null pointer is returned.
null pointer -> nullptr

Line 46:   /// If 'tz' is not found in the database, null pointer is returned.
null pointer -> nullptr
File be/src/runtime/

Line 125:   return true;
> What do you mean? The documentation doesn't say anything about an exception
Agree, I could not find any indication in the code either.
File be/src/runtime/timestamp-value.h:

Line 199:   /// conversion was successfull and false otherwise.
Comment on what the state of *this is when false is returned.

Line 202:   /// Converts from UTC to local time in the given timezone. Returns true if conversion
Comment on what the state of *this is when false is returned.
File be/src/service/

Line 357:   const char *tz = env->GetStringUTFChars(timezone, NULL);
const char*
File be/src/service/

Line 122:     "the table property to UTC for new tables. This
changes "
consistent placing of space (at line end or at line beginning)
File fe/src/main/java/org/apache/impala/analysis/

Line 67:   }
> I was copying the code that validates the skip.header.line.count table prop
My apologies, but I was wrong on this one. I think it's unfortunate, but better to check this
for every query. The alternative is to catch the issue during table loading, but Impala has
no way to fix such tables today, because you can only ALTER tables that are fully loaded.
That's an independent issue, but for now, it does seem better to check every time like for
File fe/src/main/java/org/apache/impala/analysis/

Line 184:       String timezone = getTblProperties().get(HdfsTable.TBL_PROP_PARQUET_MR_WRITE_ZONE);
> Correct. I need some help here. How can I check if the table that will be c
You can check getFileFormat() here. The only non-HDFS formats we have are HBase and Kudu.
File fe/src/main/java/org/apache/impala/service/

Line 87:   // Returns true if timezone String is valid, false otherwise.
valid according to the BE timezone database

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I3f24525ef45a2814f476bdee76655b30081079d6
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Attila Jeges <>
Gerrit-Reviewer: Alex Behm <>
Gerrit-Reviewer: Attila Jeges <>
Gerrit-Reviewer: Michael Ho
Gerrit-Reviewer: Taras Bobrovytsky <>
Gerrit-Reviewer: Zoltan Ivanfi <>
Gerrit-HasComments: Yes

View raw message