Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ff35a44
one
kgyrtkirk Jul 8, 2021
cb8ac1a
M common/src/java/org/apache/hive/http/JMXJsonServlet.java
kgyrtkirk Jul 8, 2021
56735c0
M common/src/java/org/apache/hive/http/Log4j2ConfiguratorServlet.java
kgyrtkirk Jul 8, 2021
cd91ff5
M ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
kgyrtkirk Jul 8, 2021
7dceebe
a1
kgyrtkirk Jul 8, 2021
5714a40
Revert "a1"
kgyrtkirk Jul 8, 2021
23986de
a1
kgyrtkirk Jul 8, 2021
e5d0a82
M ql/src/java/org/apache/hadoop/hive/ql/ddl/ShowUtils.java
kgyrtkirk Jul 8, 2021
8b04edd
M ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerBaseM…
kgyrtkirk Jul 8, 2021
2f0a0f1
M ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerBaseM…
kgyrtkirk Jul 8, 2021
874d6a3
M ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerExpor…
kgyrtkirk Jul 8, 2021
9f23c3a
M ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerPolic…
kgyrtkirk Jul 8, 2021
eac7b4f
M ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerPolic…
kgyrtkirk Jul 8, 2021
38f64cc
M ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerPolic…
kgyrtkirk Jul 8, 2021
4678d6f
M ql/src/java/org/apache/hadoop/hive/ql/exec/tez/AmPluginNode.java
kgyrtkirk Jul 8, 2021
0c627a8
M ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java
kgyrtkirk Jul 8, 2021
26012b3
M ql/src/java/org/apache/hadoop/hive/ql/exec/tez/WmEvent.java
kgyrtkirk Jul 8, 2021
390416e
M ql/src/java/org/apache/hadoop/hive/ql/exec/tez/WmTezSession.java
kgyrtkirk Jul 8, 2021
8082f53
M ql/src/java/org/apache/hadoop/hive/ql/parse/repl/ReplState.java
kgyrtkirk Jul 8, 2021
70fe8e0
M ql/src/java/org/apache/hadoop/hive/ql/exec/tez/WorkloadManager.java
kgyrtkirk Jul 8, 2021
773f818
M ql/src/java/org/apache/hadoop/hive/ql/exec/tez/WorkloadManager.java
kgyrtkirk Jul 8, 2021
02885aa
M ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java
kgyrtkirk Jul 8, 2021
c97fe06
M ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java
kgyrtkirk Jul 8, 2021
73ef191
M ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/JsonMeta…
kgyrtkirk Jul 8, 2021
f2e53ab
M ql/src/java/org/apache/hadoop/hive/ql/wm/Trigger.java
kgyrtkirk Jul 8, 2021
1e16d10
M ql/src/java/org/apache/hadoop/hive/ql/wm/WmContext.java
kgyrtkirk Jul 8, 2021
cc04d5c
M ql/src/test/org/apache/hadoop/hive/ql/metadata/formatting/TestJson…
kgyrtkirk Jul 8, 2021
d99199b
M ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/log/state/At…
kgyrtkirk Jul 8, 2021
74fc495
M ql/src/java/org/apache/hadoop/hive/ql/parse/repl/load/log/state/Ra…
kgyrtkirk Jul 8, 2021
6d97a68
M ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/log/state/At…
kgyrtkirk Jul 8, 2021
7e7dcaf
M ql/src/java/org/apache/hadoop/hive/ql/parse/repl/load/log/state/At…
kgyrtkirk Jul 8, 2021
5a2ab3f
M ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/io/JsonWrite…
kgyrtkirk Jul 8, 2021
000a022
M storage-api/src/java/org/apache/hadoop/hive/common/AcidMetaDataFil…
kgyrtkirk Jul 8, 2021
9caa3e1
M storage-api/src/java/org/apache/hadoop/hive/common/AcidMetaDataFil…
kgyrtkirk Jul 8, 2021
e9bcba4
RM itests/hive-unit/src/test/java/org/apache/hadoop/hive/serde2/TestS…
kgyrtkirk Jul 9, 2021
a978b1b
M hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/…
kgyrtkirk Jul 9, 2021
d6cb51c
M itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePass…
kgyrtkirk Jul 9, 2021
b15a9c6
M hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/…
kgyrtkirk Jul 9, 2021
6f8cfe6
M service/src/java/org/apache/hive/service/servlet/HS2LeadershipStat…
kgyrtkirk Jul 9, 2021
afd5f29
M service/src/java/org/apache/hive/service/servlet/HS2Peers.java
kgyrtkirk Jul 9, 2021
d7cf21a
M service/src/java/org/apache/hive/service/servlet/QueriesRESTfulAPI…
kgyrtkirk Jul 9, 2021
05f5e21
M service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
kgyrtkirk Jul 9, 2021
d0e8d91
M hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/temple…
kgyrtkirk Jul 9, 2021
689b239
M hcatalog/webhcat/svr/src/test/java/org/apache/hive/hcatalog/temple…
kgyrtkirk Jul 9, 2021
d7b817f
M hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/temple…
kgyrtkirk Jul 9, 2021
717da90
M llap-server/src/java/org/apache/hadoop/hive/llap/cli/status/LlapSt…
kgyrtkirk Jul 9, 2021
875b685
M llap-server/src/java/org/apache/hadoop/hive/llap/daemon/services/i…
kgyrtkirk Jul 9, 2021
cc7b251
M llap-server/src/java/org/apache/hadoop/hive/llap/daemon/services/i…
kgyrtkirk Jul 9, 2021
cb42121
M ql/src/java/org/apache/hadoop/hive/ql/udf/UDFJson.java
kgyrtkirk Jul 9, 2021
e17051b
M ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFJSONT…
kgyrtkirk Jul 9, 2021
0c89fc0
M ql/src/java/org/apache/hadoop/hive/ql/udf/UDFJson.java
kgyrtkirk Jul 9, 2021
013262d
ban org.codehaus.jackson
kgyrtkirk Jul 9, 2021
2534b7b
Merge remote-tracking branch 'apache/master' into HIVE-20071-jackson2
kgyrtkirk Jul 14, 2021
2c08ea2
fix
kgyrtkirk Jul 15, 2021
f12ceae
fix?
kgyrtkirk Jul 19, 2021
88a724a
Merge remote-tracking branch 'apache/master' into HIVE-20071-jackson2
kgyrtkirk Jul 20, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,14 @@

package org.apache.hadoop.hive.common.jsonexplain;

import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeMap;

import org.apache.hadoop.hive.common.jsonexplain.Op.OpType;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
Expand Down Expand Up @@ -68,7 +63,7 @@ public final class Vertex implements Comparable<Vertex>{
// tag
public String tag;
protected final Logger LOG = LoggerFactory.getLogger(this.getClass().getName());

public static enum VertexType {
MAP, REDUCE, UNION, UNKNOWN
};
Expand Down Expand Up @@ -106,16 +101,11 @@ public void addDependency(Connection connection) throws JSONException {
}

/**
* @throws JSONException
* @throws JsonParseException
* @throws JsonMappingException
* @throws IOException
* @throws Exception
* We assume that there is a single top-level Map Operator Tree or a
* Reduce Operator Tree in a vertex
*/
public void extractOpTree() throws JSONException, JsonParseException, JsonMappingException,
IOException, Exception {
public void extractOpTree() throws Exception {
if (vertexObject.length() != 0) {
for (String key : JSONObject.getNames(vertexObject)) {
if (key.equals("Map Operator Tree:")) {
Expand Down Expand Up @@ -162,16 +152,11 @@ public void extractOpTree() throws JSONException, JsonParseException, JsonMappin
* @param object
* @param parent
* @return
* @throws JSONException
* @throws JsonParseException
* @throws JsonMappingException
* @throws IOException
* @throws Exception
* assumption: each operator only has one parent but may have many
* children
*/
Op extractOp(JSONObject object, Op parent) throws JSONException, JsonParseException, JsonMappingException,
IOException, Exception {
Op extractOp(JSONObject object, Op parent) throws Exception {
String[] names = JSONObject.getNames(object);
if (names.length != 1) {
throw new Exception("Expect only one operator in " + object.toString());
Expand Down Expand Up @@ -224,8 +209,7 @@ Op extractOp(JSONObject object, Op parent) throws JSONException, JsonParseExcept
}
}

public void print(Printer printer, int indentFlag, String type, Vertex callingVertex)
throws JSONException, Exception {
public void print(Printer printer, int indentFlag, String type, Vertex callingVertex) throws Exception {
// print vertexname
if (parser.printSet.contains(this) && numReduceOp <= 1) {
if (type != null) {
Expand Down Expand Up @@ -281,7 +265,7 @@ public void print(Printer printer, int indentFlag, String type, Vertex callingVe

/**
* We check if a vertex has multiple reduce operators.
* @throws JSONException
* @throws JSONException
*/
public void checkMultiReduceOperator(boolean rewriteObject) throws JSONException {
// check if it is a reduce vertex and its children is more than 1;
Expand Down Expand Up @@ -310,8 +294,12 @@ public void setType(String type) {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Vertex vertex = (Vertex) o;
return Objects.equals(name, vertex.name) &&
Objects.equals(stage, vertex.stage) &&
Expand Down
29 changes: 15 additions & 14 deletions common/src/java/org/apache/hive/http/JMXJsonServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;

/*
* This servlet is based off of the JMXProxyServlet from Tomcat 7.0.14. It has
* been rewritten to be read only and to output in a JSON format so it is not
Expand All @@ -72,7 +73,7 @@
* attribute of a JMX bean. The format of the URL is
* <code>http://.../jmx?get=MXBeanName::AttributeName</code>
* <p>
* For example
* For example
* <code>
* http://../jmx?get=Hadoop:service=NameNode,name=NameNodeInfo::ClusterId
* </code> will return the cluster id of the namenode mxbean.
Expand All @@ -98,23 +99,23 @@
* <p>
* The servlet attempts to convert the JMXBeans into JSON. Each
* bean's attributes will be converted to a JSON object member.
*
*
* If the attribute is a boolean, a number, a string, or an array
* it will be converted to the JSON equivalent.
*
* it will be converted to the JSON equivalent.
*
* If the value is a {@link CompositeData} then it will be converted
* to a JSON object with the keys as the name of the JSON member and
* the value is converted following these same rules.
*
*
* If the value is a {@link TabularData} then it will be converted
* to an array of the {@link CompositeData} elements that it contains.
*
*
* All other objects will be converted to a string and output as such.
*
*
* The bean's name and modelerType will be returned for all beans.
*
* Optional paramater "callback" should be used to deliver JSONP response.
*
*
*/
public class JMXJsonServlet extends HttpServlet {
private static final Logger LOG = LoggerFactory.getLogger(JMXJsonServlet.class);
Expand Down Expand Up @@ -144,7 +145,7 @@ public void init() throws ServletException {

/**
* Process a GET request for the specified resource.
*
*
* @param request
* The servlet request we are processing
* @param response
Expand Down Expand Up @@ -210,8 +211,8 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) {
}

// --------------------------------------------------------- Private Methods
private void listBeans(JsonGenerator jg, ObjectName qry, String attribute,
HttpServletResponse response)
private void listBeans(JsonGenerator jg, ObjectName qry, String attribute,
HttpServletResponse response)
throws IOException {
LOG.debug("Listing beans for "+qry);
Set<ObjectName> names = null;
Expand Down Expand Up @@ -255,7 +256,7 @@ private void listBeans(JsonGenerator jg, ObjectName qry, String attribute,
+ " threw an exception", e);
} catch ( ReflectionException e ) {
// This happens when the code inside the JMX bean (setter?? from the
// java docs) threw an exception, so log it and fall back on the
// java docs) threw an exception, so log it and fall back on the
// class name
LOG.error("getting attribute " + prs + " of " + oname
+ " threw an exception", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.LoggerConfig;
import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.databind.ObjectMapper;

/**
* A servlet to configure log4j2.
* <br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.apache.hive.hcatalog.messaging.json;

import org.apache.hive.hcatalog.messaging.AddPartitionMessage;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.hive.hcatalog.common.HCatConstants;
import org.apache.hive.hcatalog.messaging.AlterPartitionMessage;
import org.apache.hive.hcatalog.messaging.AlterTableMessage;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.hadoop.hive.metastore.api.FieldSchema;
import org.apache.hive.hcatalog.common.HCatConstants;
import org.apache.hive.hcatalog.messaging.AlterTableMessage;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.apache.hive.hcatalog.messaging.json;

import org.apache.hive.hcatalog.messaging.CreateDatabaseMessage;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* JSON Implementation of CreateDatabaseMessage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.hadoop.hive.metastore.messaging.MessageBuilder;
import org.apache.hive.hcatalog.messaging.CreateFunctionMessage;
import org.apache.thrift.TException;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* JSON Implementation of CreateFunctionMessage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.apache.hive.hcatalog.messaging.json;

import org.apache.hive.hcatalog.messaging.CreateTableMessage;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* JSON implementation of CreateTableMessage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.apache.hive.hcatalog.messaging.json;

import org.apache.hive.hcatalog.messaging.DropDatabaseMessage;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* JSON implementation of DropDatabaseMessage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.hadoop.hive.metastore.messaging.MessageBuilder;
import org.apache.hive.hcatalog.messaging.DropFunctionMessage;
import org.apache.thrift.TException;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* JSON Implementation of CreateDatabaseMessage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.apache.hive.hcatalog.messaging.json;

import org.apache.hive.hcatalog.messaging.DropPartitionMessage;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.apache.hive.hcatalog.messaging.json;

import org.apache.hive.hcatalog.messaging.DropTableMessage;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* JSON implementation of DropTableMessage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.apache.hive.hcatalog.messaging.json;

import org.apache.hive.hcatalog.messaging.InsertMessage;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
import org.apache.hive.hcatalog.messaging.DropTableMessage;
import org.apache.hive.hcatalog.messaging.InsertMessage;
import org.apache.hive.hcatalog.messaging.MessageDeserializer;
import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.ObjectMapper;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
* MessageDeserializer implementation, for deserializing from JSON strings.
Expand All @@ -42,7 +43,7 @@ public class JSONMessageDeserializer extends MessageDeserializer {
static ObjectMapper mapper = new ObjectMapper(); // Thread-safe.

static {
mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@

import org.apache.hadoop.hive.ql.ErrorMsg;
import org.apache.hive.hcatalog.templeton.tool.TempletonUtils;
import org.codehaus.jackson.map.ObjectMapper;
import org.eclipse.jetty.http.HttpStatus;

import com.fasterxml.jackson.databind.ObjectMapper;

/**
* Helper class to build new json objects with new top level
* properties. Only add non-null entries.
Expand Down Expand Up @@ -93,8 +94,9 @@ public static JsonBuilder createError(String msg, int errorCode)
* Add a non-null value to the map.
*/
public JsonBuilder put(String name, Object val) {
if (val != null)
if (val != null) {
map.put(name, val);
}
return this;
}

Expand Down Expand Up @@ -134,7 +136,9 @@ public String buildJson()
public Response buildResponse() {
int status = HttpStatus.OK_200; // Server ok.
if (map.containsKey("error"))
{
status = HttpStatus.INTERNAL_SERVER_ERROR_500; // Generic http server error.
}
Object o = map.get("errorCode");
if (o != null) {
if(hiveError2HttpStatusCode.containsKey(o)) {
Expand Down Expand Up @@ -173,9 +177,9 @@ public static boolean isError(Map obj) {
*/
public static Map jsonToMap(String json)
throws IOException {
if (!TempletonUtils.isset(json))
if (!TempletonUtils.isset(json)) {
return new HashMap<String, Object>();
else {
} else {
ObjectMapper mapper = new ObjectMapper();
return mapper.readValue(json, Map.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.codehaus.jackson.map.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
* Simple exception that will return a json error payload if thrown
Expand Down Expand Up @@ -55,8 +55,9 @@ public static Response buildMessage(int httpCode, Map<String, Object> params,
String msg) {
HashMap<String, Object> err = new HashMap<String, Object>();
err.put("error", msg);
if (params != null)
if (params != null) {
err.putAll(params);
}

String json = "\"error\"";
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
import java.util.List;
import java.util.Map;

import org.codehaus.jackson.map.ObjectMapper;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import org.junit.Test;

import com.fasterxml.jackson.databind.ObjectMapper;

/**
* TestDesc - Test the desc objects that are correctly converted to
* and from json. This also sets every field of the TableDesc object.
Expand Down
Loading