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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
<jline.version>2.14.6</jline.version>
<jms.version>2.0.2</jms.version>
<joda.version>2.9.9</joda.version>
<jodd.version>3.5.2</jodd.version>
<jodd.version>6.0.0</jodd.version>
<json.version>1.8</json.version>
<junit.version>4.13</junit.version>
<junit.jupiter.version>5.6.2</junit.jupiter.version>
Expand Down
4 changes: 2 additions & 2 deletions ql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
</dependency>
<dependency>
<groupId>org.jodd</groupId>
<artifactId>jodd-core</artifactId>
<artifactId>jodd-util</artifactId>
<version>${jodd.version}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -1088,7 +1088,7 @@
<include>org.datanucleus:javax.jdo</include>
<include>commons-lang:commons-lang</include>
<include>org.apache.commons:commons-lang3</include>
<include>org.jodd:jodd-core</include>
<include>org.jodd:jodd-util</include>
<include>com.tdunning:json</include>
<include>org.apache.avro:avro</include>
<include>org.apache.avro:avro-mapred</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;

import org.apache.hadoop.hive.common.type.Timestamp;
import jodd.time.JulianDate;

import jodd.datetime.JDateTime;
import org.apache.hadoop.hive.common.type.Timestamp;
import org.apache.hadoop.hive.common.type.TimestampTZUtil;

/**
Expand Down Expand Up @@ -79,9 +79,10 @@ public static NanoTime getNanoTime(Timestamp ts, boolean skipConversion, ZoneId
if (calendar.get(Calendar.ERA) == GregorianCalendar.BC) {
year = 1 - year;
}
JDateTime jDateTime = new JDateTime(year,
JulianDate jDateTime;
jDateTime = JulianDate.of(year,
calendar.get(Calendar.MONTH) + 1, //java calendar index starting at 1.
calendar.get(Calendar.DAY_OF_MONTH));
calendar.get(Calendar.DAY_OF_MONTH), 0, 0, 0, 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This constructor call is not present in the newer code but we do the same essentially. We are setting the time to midnight(00:00:00:00) https://github.com/oblac/jodd/blob/v3.6.x/jodd-core/src/main/java/jodd/datetime/JDateTime.java#L895

int days = jDateTime.getJulianDayNumber();

long hour = calendar.get(Calendar.HOUR_OF_DAY);
Expand Down Expand Up @@ -131,11 +132,12 @@ public static Timestamp getTimestamp(NanoTime nt, boolean skipConversion, ZoneId
julianDay--;
}

JDateTime jDateTime = new JDateTime((double) julianDay);
JulianDate jDateTime;
jDateTime = JulianDate.of((double) julianDay);
Calendar calendar = getGMTCalendar();
calendar.set(Calendar.YEAR, jDateTime.getYear());
calendar.set(Calendar.MONTH, jDateTime.getMonth() - 1); //java calendar index starting at 1.
calendar.set(Calendar.DAY_OF_MONTH, jDateTime.getDay());
calendar.set(Calendar.YEAR, jDateTime.toLocalDateTime().getYear());
calendar.set(Calendar.MONTH, jDateTime.toLocalDateTime().getMonth().getValue() - 1); //java calendar index starting at 1.
calendar.set(Calendar.DAY_OF_MONTH, jDateTime.toLocalDateTime().getDayOfMonth());

int hour = (int) (remainder / (NANOS_PER_HOUR));
remainder = remainder % (NANOS_PER_HOUR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import="java.util.Collection"
import="java.util.Date"
import="java.util.List"
import="jodd.util.HtmlEncoder"
import="jodd.net.HtmlEncoder"
%>

<%
Expand Down Expand Up @@ -159,7 +159,7 @@ for (HiveSession hiveSession: hiveSessions) {
%>
<tr>
<td><%= operation.getUserName() %></td>
<td><%= HtmlEncoder.strict(operation.getQueryDisplay() == null ? "Unknown" : operation.getQueryDisplay().getQueryString()) %></td>
<td><%= HtmlEncoder.text(operation.getQueryDisplay() == null ? "Unknown" : operation.getQueryDisplay().getQueryString()) %></td>
<td><%= operation.getExecutionEngine() %>
<td><%= operation.getState() %></td>
<td><%= new Date(operation.getBeginTime()) %></td>
Expand Down Expand Up @@ -203,7 +203,7 @@ for (HiveSession hiveSession: hiveSessions) {
%>
<tr>
<td><%= operation.getUserName() %></td>
<td><%= HtmlEncoder.strict(operation.getQueryDisplay() == null ? "Unknown" : operation.getQueryDisplay().getQueryString()) %></td>
<td><%= HtmlEncoder.text(operation.getQueryDisplay() == null ? "Unknown" : operation.getQueryDisplay().getQueryString()) %></td>
<td><%= operation.getExecutionEngine() %>
<td><%= operation.getState() %></td>
<td><%= operation.getElapsedTime()/1000 %></td>
Expand Down
4 changes: 2 additions & 2 deletions service/src/resources/hive-webapps/hiveserver2/logconf.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import="java.util.Collection"
import="java.util.Date"
import="java.util.List"
import="jodd.util.HtmlEncoder"
import="jodd.net.HtmlEncoder"
%>

<%
Expand Down Expand Up @@ -142,4 +142,4 @@
</div>

</body>
</html>
</html>