The following issues were found
src/test/java/com/alibaba/json/bvt/issue_1600/Issue1636.java
8 issues
Line: 9
import junit.framework.TestCase;
public class Issue1636 extends TestCase {
public void test_for_issue_1() throws Exception {
Item1 item = JSON.parseObject("{\"modelId\":1001}", Item1.class);
assertEquals(1001, item.modelId);
}
public void test_for_issue_2() throws Exception {
Reported by PMD.
Line: 11
public class Issue1636 extends TestCase {
public void test_for_issue_1() throws Exception {
Item1 item = JSON.parseObject("{\"modelId\":1001}", Item1.class);
assertEquals(1001, item.modelId);
}
public void test_for_issue_2() throws Exception {
Item2 item = JSON.parseObject("{\"modelId\":1001}", Item2.class);
assertEquals(1001, item.modelId);
Reported by PMD.
Line: 14
assertEquals(1001, item.modelId);
}
public void test_for_issue_2() throws Exception {
Item2 item = JSON.parseObject("{\"modelId\":1001}", Item2.class);
assertEquals(1001, item.modelId);
}
public static class Item1 {
Reported by PMD.
Line: 16
public void test_for_issue_2() throws Exception {
Item2 item = JSON.parseObject("{\"modelId\":1001}", Item2.class);
assertEquals(1001, item.modelId);
}
public static class Item1 {
@JSONField
private int modelId;
Reported by PMD.
Line: 21
public static class Item1 {
@JSONField
private int modelId;
@JSONCreator
public Item1(@JSONField int modelId){
// 这里为零
this.modelId=modelId;
Reported by PMD.
Line: 21
public static class Item1 {
@JSONField
private int modelId;
@JSONCreator
public Item1(@JSONField int modelId){
// 这里为零
this.modelId=modelId;
Reported by PMD.
Line: 31
}
public static class Item2 {
private int modelId;
@JSONCreator
public Item2(int modelId){
// 这里为零
this.modelId=modelId;
Reported by PMD.
Line: 31
}
public static class Item2 {
private int modelId;
@JSONCreator
public Item2(int modelId){
// 这里为零
this.modelId=modelId;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/LongFieldTest_2_stream.java
8 issues
Line: 16
public class LongFieldTest_2_stream extends TestCase {
public void test_min() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
String text = JSON.toJSONString(v);
Reported by PMD.
Line: 24
JSONReader reader = new JSONReader(new StringReader(text));
V0 v1 = reader.readObject(V0.class);
Assert.assertEquals(v1.getValue(), v.getValue());
reader.close();
}
public void test_max() throws Exception {
V0 v = new V0();
Reported by PMD.
Line: 28
reader.close();
}
public void test_max() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
String text = JSON.toJSONString(v);
Reported by PMD.
Line: 37
JSONReader reader = new JSONReader(new StringReader(text));
V0 v1 = reader.readObject(V0.class);
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_min_array() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
Reported by PMD.
Line: 40
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_min_array() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
String text = JSON.toJSONString(v, SerializerFeature.BeanToArray);
Reported by PMD.
Line: 49
JSONReader reader = new JSONReader(new StringReader(text), Feature.SupportArrayToBean);
V0 v1 = reader.readObject(V0.class);
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_max_array() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
Reported by PMD.
Line: 52
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_max_array() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
String text = JSON.toJSONString(v, SerializerFeature.BeanToArray);
Reported by PMD.
Line: 61
JSONReader reader = new JSONReader(new StringReader(text), Feature.SupportArrayToBean);
V0 v1 = reader.readObject(V0.class);
Assert.assertEquals(v.getValue(), v1.getValue());
}
public static class V0 {
private Long value;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/array/FieldFloatArrayTest.java
8 issues
Line: 10
* Created by wenshao on 11/01/2017.
*/
public class FieldFloatArrayTest extends TestCase {
public void test_intArray() throws Exception {
Model model = JSON.parseObject("{\"value\":[1,2.1,-0.3]}", Model.class);
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1f, model.value[0]);
assertEquals(2.1f, model.value[1]);
Reported by PMD.
Line: 10
* Created by wenshao on 11/01/2017.
*/
public class FieldFloatArrayTest extends TestCase {
public void test_intArray() throws Exception {
Model model = JSON.parseObject("{\"value\":[1,2.1,-0.3]}", Model.class);
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1f, model.value[0]);
assertEquals(2.1f, model.value[1]);
Reported by PMD.
Line: 12
public class FieldFloatArrayTest extends TestCase {
public void test_intArray() throws Exception {
Model model = JSON.parseObject("{\"value\":[1,2.1,-0.3]}", Model.class);
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1f, model.value[0]);
assertEquals(2.1f, model.value[1]);
assertEquals(-0.3f, model.value[2]);
}
Reported by PMD.
Line: 13
public void test_intArray() throws Exception {
Model model = JSON.parseObject("{\"value\":[1,2.1,-0.3]}", Model.class);
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1f, model.value[0]);
assertEquals(2.1f, model.value[1]);
assertEquals(-0.3f, model.value[2]);
}
Reported by PMD.
Line: 14
Model model = JSON.parseObject("{\"value\":[1,2.1,-0.3]}", Model.class);
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1f, model.value[0]);
assertEquals(2.1f, model.value[1]);
assertEquals(-0.3f, model.value[2]);
}
public static class Model {
Reported by PMD.
Line: 15
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1f, model.value[0]);
assertEquals(2.1f, model.value[1]);
assertEquals(-0.3f, model.value[2]);
}
public static class Model {
public float[] value;
Reported by PMD.
Line: 16
assertEquals(3, model.value.length);
assertEquals(1f, model.value[0]);
assertEquals(2.1f, model.value[1]);
assertEquals(-0.3f, model.value[2]);
}
public static class Model {
public float[] value;
}
Reported by PMD.
Line: 20
}
public static class Model {
public float[] value;
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/issue_3300/Issue3358.java
8 issues
Line: 13
* @Date :Created in 19:07 2020/7/21
*/
public class Issue3358 extends TestCase {
public void test_for_issue() throws Exception {
Model validateCode = new Model("111", 600);
String jsonString = JSON.toJSONString(validateCode);
Model backModel = JSON.parseObject(jsonString, Model.class);
assertEquals(validateCode.getExpireTime(), backModel.getExpireTime());
Reported by PMD.
Line: 13
* @Date :Created in 19:07 2020/7/21
*/
public class Issue3358 extends TestCase {
public void test_for_issue() throws Exception {
Model validateCode = new Model("111", 600);
String jsonString = JSON.toJSONString(validateCode);
Model backModel = JSON.parseObject(jsonString, Model.class);
assertEquals(validateCode.getExpireTime(), backModel.getExpireTime());
Reported by PMD.
Line: 17
Model validateCode = new Model("111", 600);
String jsonString = JSON.toJSONString(validateCode);
Model backModel = JSON.parseObject(jsonString, Model.class);
assertEquals(validateCode.getExpireTime(), backModel.getExpireTime());
jsonString = "{\"code\":\"111\"}";
backModel = JSON.parseObject(jsonString, Model.class);
assertNull(backModel.getExpireTime());
}
Reported by PMD.
Line: 17
Model validateCode = new Model("111", 600);
String jsonString = JSON.toJSONString(validateCode);
Model backModel = JSON.parseObject(jsonString, Model.class);
assertEquals(validateCode.getExpireTime(), backModel.getExpireTime());
jsonString = "{\"code\":\"111\"}";
backModel = JSON.parseObject(jsonString, Model.class);
assertNull(backModel.getExpireTime());
}
Reported by PMD.
Line: 21
jsonString = "{\"code\":\"111\"}";
backModel = JSON.parseObject(jsonString, Model.class);
assertNull(backModel.getExpireTime());
}
public static class Model {
private String code;
Reported by PMD.
Line: 21
jsonString = "{\"code\":\"111\"}";
backModel = JSON.parseObject(jsonString, Model.class);
assertNull(backModel.getExpireTime());
}
public static class Model {
private String code;
Reported by PMD.
Line: 24
assertNull(backModel.getExpireTime());
}
public static class Model {
private String code;
private LocalDateTime expireTime;
public String getCode() {
Reported by PMD.
Line: 57
}
public boolean isExpried() {
return LocalDateTime.now().isAfter(getExpireTime());
}
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/LongFieldTest_2_private.java
8 issues
Line: 14
public class LongFieldTest_2_private extends TestCase {
public void test_min() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
String text = JSON.toJSONString(v);
Reported by PMD.
Line: 22
V0 v1 = JSON.parseObject(text, V0.class);
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_max() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
Reported by PMD.
Line: 25
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_max() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
String text = JSON.toJSONString(v);
Reported by PMD.
Line: 33
V0 v1 = JSON.parseObject(text, V0.class);
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_min_array() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
Reported by PMD.
Line: 36
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_min_array() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
String text = JSON.toJSONString(v, SerializerFeature.BeanToArray);
Reported by PMD.
Line: 44
V0 v1 = JSON.parseObject(text, V0.class, Feature.SupportArrayToBean);
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_max_array() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
Reported by PMD.
Line: 47
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_max_array() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
String text = JSON.toJSONString(v, SerializerFeature.BeanToArray);
Reported by PMD.
Line: 55
V0 v1 = JSON.parseObject(text, V0.class, Feature.SupportArrayToBean);
Assert.assertEquals(v1.getValue(), v.getValue());
}
private static class V0 {
private Long value;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/array/FieldIntArrayTest2.java
8 issues
Line: 10
* Created by wenshao on 11/01/2017.
*/
public class FieldIntArrayTest2 extends TestCase {
public void test_intArray() throws Exception {
Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1, model.value[0]);
assertEquals(0, model.value[1]);
Reported by PMD.
Line: 10
* Created by wenshao on 11/01/2017.
*/
public class FieldIntArrayTest2 extends TestCase {
public void test_intArray() throws Exception {
Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1, model.value[0]);
assertEquals(0, model.value[1]);
Reported by PMD.
Line: 12
public class FieldIntArrayTest2 extends TestCase {
public void test_intArray() throws Exception {
Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1, model.value[0]);
assertEquals(0, model.value[1]);
assertEquals(3, model.value[2]);
}
Reported by PMD.
Line: 13
public void test_intArray() throws Exception {
Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1, model.value[0]);
assertEquals(0, model.value[1]);
assertEquals(3, model.value[2]);
}
Reported by PMD.
Line: 14
Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1, model.value[0]);
assertEquals(0, model.value[1]);
assertEquals(3, model.value[2]);
}
public static class Model {
Reported by PMD.
Line: 15
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1, model.value[0]);
assertEquals(0, model.value[1]);
assertEquals(3, model.value[2]);
}
public static class Model {
public int[] value;
Reported by PMD.
Line: 16
assertEquals(3, model.value.length);
assertEquals(1, model.value[0]);
assertEquals(0, model.value[1]);
assertEquals(3, model.value[2]);
}
public static class Model {
public int[] value;
}
Reported by PMD.
Line: 20
}
public static class Model {
public int[] value;
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/writeAsArray/WriteAsArray_float2_public.java
8 issues
Line: 13
import junit.framework.TestCase;
public class WriteAsArray_float2_public extends TestCase {
public void test_0 () throws Exception {
VO vo = new VO();
vo.setId(123F);
vo.setName("wenshao");
String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);
Reported by PMD.
Line: 26
Assert.assertEquals(vo.name, vo2.name);
}
public void test_error() throws Exception {
Exception error = null;
try {
JSON.parseObject("[123.A,\"wenshao\"]", VO.class, Feature.SupportArrayToBean);
} catch (JSONException ex) {
error = ex;
Reported by PMD.
Line: 36
Assert.assertNotNull(error);
}
public void test_error1() throws Exception {
Exception error = null;
try {
JSON.parseObject("[\"A\",\"wenshao\"]", VO.class, Feature.SupportArrayToBean);
} catch (JSONException ex) {
error = ex;
Reported by PMD.
Line: 46
Assert.assertNotNull(error);
}
public void test_error2() throws Exception {
Exception error = null;
try {
JSON.parseObject("[123:\"wenshao\"]", VO.class, Feature.SupportArrayToBean);
} catch (JSONException ex) {
error = ex;
Reported by PMD.
Line: 56
Assert.assertNotNull(error);
}
public static class VO {
private float id;
private String name;
public float getId() {
return id;
Reported by PMD.
Line: 27
}
public void test_error() throws Exception {
Exception error = null;
try {
JSON.parseObject("[123.A,\"wenshao\"]", VO.class, Feature.SupportArrayToBean);
} catch (JSONException ex) {
error = ex;
}
Reported by PMD.
Line: 37
}
public void test_error1() throws Exception {
Exception error = null;
try {
JSON.parseObject("[\"A\",\"wenshao\"]", VO.class, Feature.SupportArrayToBean);
} catch (JSONException ex) {
error = ex;
}
Reported by PMD.
Line: 47
}
public void test_error2() throws Exception {
Exception error = null;
try {
JSON.parseObject("[123:\"wenshao\"]", VO.class, Feature.SupportArrayToBean);
} catch (JSONException ex) {
error = ex;
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/TreeSetFieldTest.java
8 issues
Line: 13
public class TreeSetFieldTest extends TestCase {
public void test_null() throws Exception {
Entity value = JSON.parseObject("{value:null}", Entity.class);
Assert.assertNull(value.getValue());
}
public void test_empty() throws Exception {
Reported by PMD.
Line: 15
public void test_null() throws Exception {
Entity value = JSON.parseObject("{value:null}", Entity.class);
Assert.assertNull(value.getValue());
}
public void test_empty() throws Exception {
Entity value = JSON.parseObject("{value:[]}", Entity.class);
Assert.assertEquals(0, value.getValue().size());
Reported by PMD.
Line: 18
Assert.assertNull(value.getValue());
}
public void test_empty() throws Exception {
Entity value = JSON.parseObject("{value:[]}", Entity.class);
Assert.assertEquals(0, value.getValue().size());
}
private static class Entity {
Reported by PMD.
Line: 20
public void test_empty() throws Exception {
Entity value = JSON.parseObject("{value:[]}", Entity.class);
Assert.assertEquals(0, value.getValue().size());
}
private static class Entity {
private TreeSet value;
Reported by PMD.
Line: 20
public void test_empty() throws Exception {
Entity value = JSON.parseObject("{value:[]}", Entity.class);
Assert.assertEquals(0, value.getValue().size());
}
private static class Entity {
private TreeSet value;
Reported by PMD.
Line: 25
private static class Entity {
private TreeSet value;
public TreeSet getValue() {
return value;
}
Reported by PMD.
Line: 27
private TreeSet value;
public TreeSet getValue() {
return value;
}
public void setValue(TreeSet value) {
this.value = value;
Reported by PMD.
Line: 31
return value;
}
public void setValue(TreeSet value) {
this.value = value;
}
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/util/Base64Test.java
8 issues
Line: 7
import junit.framework.TestCase;
public class Base64Test extends TestCase {
public void test_base64() throws Exception {
String str = "阿里巴巴網絡有限公司主要通過旗下三個交易市場協助世界各地數以百萬計的買家和供應商從事網上生意,包括:集中服務全球進出口商的國際交易市場(www.alibaba.com);集中國內貿易的中國交易市場(www.1688.com);以及在國際交易市場上的全球批發交易平台(www.aliexpress.com),為規模較小、需要小批量貨物快速付運的買家提供服務。更多>>";
byte[] bytes = str.getBytes("UTF8");
String base64Str = com.alibaba.json.test.Base64.encodeToString(bytes, false);
Reported by PMD.
Line: 7
import junit.framework.TestCase;
public class Base64Test extends TestCase {
public void test_base64() throws Exception {
String str = "阿里巴巴網絡有限公司主要通過旗下三個交易市場協助世界各地數以百萬計的買家和供應商從事網上生意,包括:集中服務全球進出口商的國際交易市場(www.alibaba.com);集中國內貿易的中國交易市場(www.1688.com);以及在國際交易市場上的全球批發交易平台(www.aliexpress.com),為規模較小、需要小批量貨物快速付運的買家提供服務。更多>>";
byte[] bytes = str.getBytes("UTF8");
String base64Str = com.alibaba.json.test.Base64.encodeToString(bytes, false);
Reported by PMD.
Line: 10
public void test_base64() throws Exception {
String str = "阿里巴巴網絡有限公司主要通過旗下三個交易市場協助世界各地數以百萬計的買家和供應商從事網上生意,包括:集中服務全球進出口商的國際交易市場(www.alibaba.com);集中國內貿易的中國交易市場(www.1688.com);以及在國際交易市場上的全球批發交易平台(www.aliexpress.com),為規模較小、需要小批量貨物快速付運的買家提供服務。更多>>";
byte[] bytes = str.getBytes("UTF8");
String base64Str = com.alibaba.json.test.Base64.encodeToString(bytes, false);
{
byte[] bytes2 = Base64.decodeFast(base64Str);
assertEquals(str, new String(bytes2, "UTF8"));
Reported by PMD.
Line: 10
public void test_base64() throws Exception {
String str = "阿里巴巴網絡有限公司主要通過旗下三個交易市場協助世界各地數以百萬計的買家和供應商從事網上生意,包括:集中服務全球進出口商的國際交易市場(www.alibaba.com);集中國內貿易的中國交易市場(www.1688.com);以及在國際交易市場上的全球批發交易平台(www.aliexpress.com),為規模較小、需要小批量貨物快速付運的買家提供服務。更多>>";
byte[] bytes = str.getBytes("UTF8");
String base64Str = com.alibaba.json.test.Base64.encodeToString(bytes, false);
{
byte[] bytes2 = Base64.decodeFast(base64Str);
assertEquals(str, new String(bytes2, "UTF8"));
Reported by PMD.
Line: 11
String str = "阿里巴巴網絡有限公司主要通過旗下三個交易市場協助世界各地數以百萬計的買家和供應商從事網上生意,包括:集中服務全球進出口商的國際交易市場(www.alibaba.com);集中國內貿易的中國交易市場(www.1688.com);以及在國際交易市場上的全球批發交易平台(www.aliexpress.com),為規模較小、需要小批量貨物快速付運的買家提供服務。更多>>";
byte[] bytes = str.getBytes("UTF8");
String base64Str = com.alibaba.json.test.Base64.encodeToString(bytes, false);
{
byte[] bytes2 = Base64.decodeFast(base64Str);
assertEquals(str, new String(bytes2, "UTF8"));
}
Reported by PMD.
Line: 15
{
byte[] bytes2 = Base64.decodeFast(base64Str);
assertEquals(str, new String(bytes2, "UTF8"));
}
{
byte[] bytes2 = Base64.decodeFast(base64Str, 0, base64Str.length());
assertEquals(str, new String(bytes2, "UTF8"));
Reported by PMD.
Line: 20
{
byte[] bytes2 = Base64.decodeFast(base64Str, 0, base64Str.length());
assertEquals(str, new String(bytes2, "UTF8"));
}
{
byte[] bytes2 = Base64.decodeFast(base64Str.toCharArray(), 0, base64Str.length());
assertEquals(str, new String(bytes2, "UTF8"));
Reported by PMD.
Line: 25
{
byte[] bytes2 = Base64.decodeFast(base64Str.toCharArray(), 0, base64Str.length());
assertEquals(str, new String(bytes2, "UTF8"));
}
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/issue_3000/Issue3031.java
8 issues
Line: 9
public class Issue3031 extends TestCase {
public void test_for_issue() throws Exception {
String str = "{\"success\":true,\"message\":null,\"data\":[{\"tblId\":78,\"partId\":104,\"values\":[\"p001\",\"q001\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":182,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":182,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\"},\"parametersSize\":6},{\"tblId\":78,\"partId\":105,\"values\":[\"p001\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":183,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":183,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7},{\"tblId\":78,\"partId\":106,\"values\":[\"p002\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":184,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":184,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7}]}";
System.out.println(str);
ResultData obj = JSON.parseObject(str, ResultData.class);
}
public static class ResultData
{
Reported by PMD.
Line: 7
import junit.framework.TestCase;
public class Issue3031 extends TestCase {
public void test_for_issue() throws Exception {
String str = "{\"success\":true,\"message\":null,\"data\":[{\"tblId\":78,\"partId\":104,\"values\":[\"p001\",\"q001\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":182,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":182,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\"},\"parametersSize\":6},{\"tblId\":78,\"partId\":105,\"values\":[\"p001\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":183,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":183,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7},{\"tblId\":78,\"partId\":106,\"values\":[\"p002\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":184,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":184,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7}]}";
System.out.println(str);
ResultData obj = JSON.parseObject(str, ResultData.class);
}
Reported by PMD.
Line: 7
import junit.framework.TestCase;
public class Issue3031 extends TestCase {
public void test_for_issue() throws Exception {
String str = "{\"success\":true,\"message\":null,\"data\":[{\"tblId\":78,\"partId\":104,\"values\":[\"p001\",\"q001\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":182,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":182,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\"},\"parametersSize\":6},{\"tblId\":78,\"partId\":105,\"values\":[\"p001\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":183,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":183,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7},{\"tblId\":78,\"partId\":106,\"values\":[\"p002\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":184,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":184,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7}]}";
System.out.println(str);
ResultData obj = JSON.parseObject(str, ResultData.class);
}
Reported by PMD.
Line: 10
public void test_for_issue() throws Exception {
String str = "{\"success\":true,\"message\":null,\"data\":[{\"tblId\":78,\"partId\":104,\"values\":[\"p001\",\"q001\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":182,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":182,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\"},\"parametersSize\":6},{\"tblId\":78,\"partId\":105,\"values\":[\"p001\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":183,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":183,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7},{\"tblId\":78,\"partId\":106,\"values\":[\"p002\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":184,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":184,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7}]}";
System.out.println(str);
ResultData obj = JSON.parseObject(str, ResultData.class);
}
public static class ResultData
{
private boolean success;
Reported by PMD.
Line: 15
public static class ResultData
{
private boolean success;
private String message;
private Object data;
}
}
Reported by PMD.
Line: 16
public static class ResultData
{
private boolean success;
private String message;
private Object data;
}
}
Reported by PMD.
Line: 17
{
private boolean success;
private String message;
private Object data;
}
}
Reported by PMD.
Line: 10
public void test_for_issue() throws Exception {
String str = "{\"success\":true,\"message\":null,\"data\":[{\"tblId\":78,\"partId\":104,\"values\":[\"p001\",\"q001\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":182,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":182,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\"},\"parametersSize\":6},{\"tblId\":78,\"partId\":105,\"values\":[\"p001\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":183,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":183,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7},{\"tblId\":78,\"partId\":106,\"values\":[\"p002\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":184,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":184,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7}]}";
System.out.println(str);
ResultData obj = JSON.parseObject(str, ResultData.class);
}
public static class ResultData
{
private boolean success;
Reported by PMD.