Skip to content

HIVE-24286: Render date and time with progress of Hive on Tez - #4424

Merged
ayushtkn merged 2 commits into
apache:masterfrom
okumin:HIVE-24286-progress-with-date
Jun 22, 2023
Merged

HIVE-24286: Render date and time with progress of Hive on Tez#4424
ayushtkn merged 2 commits into
apache:masterfrom
okumin:HIVE-24286-progress-with-date

Conversation

@okumin

@okumin okumin commented Jun 16, 2023

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add date and time to the progress log when hive.server2.in.place.progress is disabled.
https://issues.apache.org/jira/browse/HIVE-24286

Why are the changes needed?

With hive.server2.in.place.progress disabled, Hive prints progress periodically. We want to add date and time to each line so that we can review what phase took time or where the job got stuck easily. As I mentioned in HIVE-24286, Hive on MR or Hive on Spark add date and time.

INFO  : Map 1: -/-	Reducer 2: 0/1	
INFO  : Map 1: 0/1	Reducer 2: 0/1	
INFO  : Map 1: 0(+1)/1	Reducer 2: 0/1	
INFO  : Map 1: 1/1	Reducer 2: 0(+1)/1	
INFO  : Map 1: 1/1	Reducer 2: 1/1	

Does this PR introduce any user-facing change?

The log format can change if a user configures hive.server2.in.place.progress=false.

Is the change a dependency upgrade?

No

How was this patch tested?

I tested the patch on my local machine.

INFO  : 2023-06-15 14:07:44,590	Map 1: -/-	Reducer 2: 0/1	
INFO  : 2023-06-15 14:07:45,605	Map 1: 0/1	Reducer 2: 0/1	
INFO  : 2023-06-15 14:07:48,135	Map 1: 0(+1)/1	Reducer 2: 0/1	
INFO  : 2023-06-15 14:07:49,658	Map 1: 1/1	Reducer 2: 1/1	

@SourabhBadhya SourabhBadhya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1 (pending tests).

LOGGER.info(report);
} else {
monitor.console.printInfo(report);
String time = REPORT_DATE_TIME_FORMATTER.format(LocalDateTime.now());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LocalDateTime won't be confusing? Just thinking how it will be look like if a user will be EST but the server time will be PST.
Just try to imagine the output.

Overall the code is OK. Could you please move the jira in-progress state?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed the behavior of MapReduce since I actually wrote this patch while I was migrating Hive on MR on Hive on Tez.

Looking at other usages, it could be kinder to use HiveConf#getLocalTimeZone. Let me check and try it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aturoczy I updated it. I think it is reasonable since it is consistent with other places such as CURRENT_DATE UDF.

I have also verified the property takes effect.

By default, the default one, UTC in this case, is used.

$ beeline -e 'SELECT sum(price) FROM orders' --hiveconf hive.server2.in.place.progress=false
...
INFO  : 2023-06-16 16:56:55,735	Map 1: -/-	Reducer 2: 0/1	
INFO  : 2023-06-16 16:56:56,240	Map 1: 0/1	Reducer 2: 0/1	

The same offset is used when we explicitly give hive.local.time.zone=UTC.

$ beeline -e 'SELECT sum(price) FROM orders' --hiveconf hive.server2.in.place.progress=false --hiveconf hive.local.time.zone=UTC
...
INFO  : 2023-06-16 16:59:44,985	Map 1: -/-	Reducer 2: 0/1	
INFO  : 2023-06-16 16:59:45,995	Map 1: 0/1	Reducer 2: 0/1	

Configuring other time zones, we see a date and time with the offset.

$ beeline -e 'SELECT sum(price) FROM orders' --hiveconf hive.server2.in.place.progress=false --hiveconf hive.local.time.zone=America/Los_Angeles
...
INFO  : 2023-06-16 10:02:17,700	Map 1: -/-	Reducer 2: 0/1	
INFO  : 2023-06-16 10:02:18,712	Map 1: 0/1	Reducer 2: 0/1	
...
$ beeline -e 'SELECT sum(price) FROM orders' --hiveconf hive.server2.in.place.progress=false --hiveconf hive.local.time.zone=Asia/Tokyo
...
INFO  : 2023-06-17 02:03:21,041	Map 1: -/-	Reducer 2: 0/1	
INFO  : 2023-06-17 02:03:22,050	Map 1: 0/1	Reducer 2: 0/1	

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@ayushtkn ayushtkn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ayushtkn
ayushtkn merged commit be379bd into apache:master Jun 22, 2023
@okumin
okumin deleted the HIVE-24286-progress-with-date branch June 22, 2023 06:12
@okumin

okumin commented Jun 22, 2023

Copy link
Copy Markdown
Contributor Author

Thank you!

yeahyung pushed a commit to yeahyung/hive that referenced this pull request Jul 20, 2023
tarak271 pushed a commit to tarak271/hive-1 that referenced this pull request Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants