This is an automated email from the ASF dual-hosted git repository. dzamo pushed a commit to branch 1.20 in repository https://gitbox.apache.org/repos/asf/drill.git
commit fda97be16beec83b189cade85f5af155de3f365d Author: PJ Fanning <pjfann...@users.noreply.github.com> AuthorDate: Thu Sep 8 22:09:48 2022 +0800 [MINOR UPDATE]: Disable lgtm build (#2631) --- .lgtm.yml | 22 ---------------------- .../store/hdf5/writers/HDF5ByteDataWriter.java | 4 ++-- .../store/hdf5/writers/HDF5DoubleDataWriter.java | 4 ++-- .../store/hdf5/writers/HDF5FloatDataWriter.java | 4 ++-- .../exec/store/hdf5/writers/HDF5IntDataWriter.java | 4 ++-- .../store/hdf5/writers/HDF5LongDataWriter.java | 4 ++-- .../store/hdf5/writers/HDF5SmallIntDataWriter.java | 4 ++-- .../hdf5/writers/HDF5TimestampDataWriter.java | 4 ++-- .../exec/store/mapr/TableFormatPluginConfig.java | 2 +- .../apache/drill/exec/udfs/CryptoFunctions.java | 4 ++-- .../expr/fn/impl/CollectListMapsAggFunction.java | 2 +- .../drill/exec/expr/fn/impl/SchemaFunctions.java | 4 ++-- .../java/org/apache/drill/exec/record/DeadBuf.java | 2 +- .../exec/record/metadata/AbstractPropertied.java | 2 +- .../drill/exec/util/JsonStringArrayList.java | 2 +- .../apache/drill/exec/util/JsonStringHashMap.java | 2 +- pom.xml | 1 - 17 files changed, 24 insertions(+), 47 deletions(-) diff --git a/.lgtm.yml b/.lgtm.yml deleted file mode 100644 index a12bee6b43..0000000000 --- a/.lgtm.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# Format of this file: https://lgtm.com/help/lgtm/lgtm.yml-configuration-file -path_classifiers: - documentation: - - docs/dev/* - excludes: - - exec/java-exec/src/main/resources/rest/static/js/*.js diff --git a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5ByteDataWriter.java b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5ByteDataWriter.java index d66d6ddf31..94ce2da3cf 100644 --- a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5ByteDataWriter.java +++ b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5ByteDataWriter.java @@ -65,10 +65,10 @@ public class HDF5ByteDataWriter extends HDF5DataWriter { @Override public boolean write() { - if (counter > data.length) { + if (!hasNext()) { return false; } else { - colWriter.setInt(data[counter++]); //lgtm [java/index-out-of-bounds] + colWriter.setInt(data[counter++]); return true; } } diff --git a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5DoubleDataWriter.java b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5DoubleDataWriter.java index 93b55c4935..e619dfc214 100644 --- a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5DoubleDataWriter.java +++ b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5DoubleDataWriter.java @@ -63,10 +63,10 @@ public class HDF5DoubleDataWriter extends HDF5DataWriter { @Override public boolean write() { - if (counter > data.length) { + if (!hasNext()) { return false; } else { - colWriter.setDouble(data[counter++]); // lgtm [java/index-out-of-bounds] + colWriter.setDouble(data[counter++]); return true; } } diff --git a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5FloatDataWriter.java b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5FloatDataWriter.java index 418db01186..769c57fbd3 100644 --- a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5FloatDataWriter.java +++ b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5FloatDataWriter.java @@ -63,10 +63,10 @@ public class HDF5FloatDataWriter extends HDF5DataWriter { @Override public boolean write() { - if (counter > data.length) { + if (!hasNext()) { return false; } else { - colWriter.setDouble(data[counter++]); // lgtm [java/index-out-of-bounds] + colWriter.setDouble(data[counter++]); return true; } } diff --git a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5IntDataWriter.java b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5IntDataWriter.java index ef0de85022..6eee89ecaf 100644 --- a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5IntDataWriter.java +++ b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5IntDataWriter.java @@ -64,10 +64,10 @@ public class HDF5IntDataWriter extends HDF5DataWriter { @Override public boolean write() { - if (counter > data.length) { + if (!hasNext()) { return false; } else { - colWriter.setInt(data[counter++]); // lgtm [java/index-out-of-bounds] + colWriter.setInt(data[counter++]); return true; } } diff --git a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5LongDataWriter.java b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5LongDataWriter.java index 91d218d5f4..1fe51b04c6 100644 --- a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5LongDataWriter.java +++ b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5LongDataWriter.java @@ -63,10 +63,10 @@ public class HDF5LongDataWriter extends HDF5DataWriter { @Override public boolean write() { - if (counter > data.length) { + if (!hasNext()) { return false; } else { - colWriter.setLong(data[counter++]); // lgtm [java/index-out-of-bounds] + colWriter.setLong(data[counter++]); return true; } } diff --git a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5SmallIntDataWriter.java b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5SmallIntDataWriter.java index 2f999bd991..d355457605 100644 --- a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5SmallIntDataWriter.java +++ b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5SmallIntDataWriter.java @@ -65,10 +65,10 @@ public class HDF5SmallIntDataWriter extends HDF5DataWriter { @Override public boolean write() { - if (counter > data.length) { + if (!hasNext()) { return false; } else { - colWriter.setInt(data[counter++]); // lgtm [java/index-out-of-bounds] + colWriter.setInt(data[counter++]); return true; } } diff --git a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5TimestampDataWriter.java b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5TimestampDataWriter.java index bdec31a669..bb2129e6ed 100644 --- a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5TimestampDataWriter.java +++ b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/writers/HDF5TimestampDataWriter.java @@ -42,10 +42,10 @@ public class HDF5TimestampDataWriter extends HDF5DataWriter { @Override public boolean write() { - if (counter > data.length) { + if (!hasNext()) { return false; } else { - colWriter.setTimestamp(Instant.ofEpochMilli(data[counter++])); // lgtm [java/index-out-of-bounds] + colWriter.setTimestamp(Instant.ofEpochMilli(data[counter++])); return true; } } diff --git a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/mapr/TableFormatPluginConfig.java b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/mapr/TableFormatPluginConfig.java index 0122254dd3..ffd3d92150 100644 --- a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/mapr/TableFormatPluginConfig.java +++ b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/mapr/TableFormatPluginConfig.java @@ -20,7 +20,7 @@ package org.apache.drill.exec.store.mapr; import org.apache.drill.common.logical.FormatPluginConfig; public abstract class TableFormatPluginConfig implements FormatPluginConfig { - //lgtm [java/inconsistent-equals-and-hashcode] + @Override public boolean equals(Object obj) { if (this == obj) { diff --git a/contrib/udfs/src/main/java/org/apache/drill/exec/udfs/CryptoFunctions.java b/contrib/udfs/src/main/java/org/apache/drill/exec/udfs/CryptoFunctions.java index e7040891fe..01fae080cd 100644 --- a/contrib/udfs/src/main/java/org/apache/drill/exec/udfs/CryptoFunctions.java +++ b/contrib/udfs/src/main/java/org/apache/drill/exec/udfs/CryptoFunctions.java @@ -285,7 +285,7 @@ public class CryptoFunctions { keyByteArray = java.util.Arrays.copyOf(keyByteArray, 16); javax.crypto.spec.SecretKeySpec secretKey = new javax.crypto.spec.SecretKeySpec(keyByteArray, "AES"); - javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance("AES/ECB/PKCS5Padding"); // lgtm [java/weak-cryptographic-algorithm] + javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance("AES/ECB/PKCS5Padding"); cipher.init(javax.crypto.Cipher.ENCRYPT_MODE, secretKey); encryptedText = javax.xml.bind.DatatypeConverter.printBase64Binary(cipher.doFinal(input.getBytes(java.nio.charset.StandardCharsets.UTF_8))); } catch (Exception e) { @@ -336,7 +336,7 @@ public class CryptoFunctions { keyByteArray = java.util.Arrays.copyOf(keyByteArray, 16); javax.crypto.spec.SecretKeySpec secretKey = new javax.crypto.spec.SecretKeySpec(keyByteArray, "AES"); - javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance("AES/ECB/PKCS5Padding"); // lgtm [java/weak-cryptographic-algorithm] + javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance("AES/ECB/PKCS5Padding"); cipher.init(javax.crypto.Cipher.DECRYPT_MODE, secretKey); decryptedText = new String(cipher.doFinal(javax.xml.bind.DatatypeConverter.parseBase64Binary(input))); } catch (Exception e) { diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/CollectListMapsAggFunction.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/CollectListMapsAggFunction.java index f88f0e4fe8..c232edc441 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/CollectListMapsAggFunction.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/CollectListMapsAggFunction.java @@ -60,7 +60,7 @@ public class CollectListMapsAggFunction implements DrillAggFunc { for (int i = 0; i < inputs.length; i += 2) { org.apache.drill.exec.vector.complex.MapUtility.writeToMapFromReader( - inputs[i + 1], mapWriter, inputs[i].readText().toString(), "CollectListMapsAggFunction"); // lgtm [java/index-out-of-bounds] + inputs[i + 1], mapWriter, inputs[i].readText().toString(), "CollectListMapsAggFunction"); } mapWriter.end(); } diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/SchemaFunctions.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/SchemaFunctions.java index a71447eb4a..b19905bf98 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/SchemaFunctions.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/SchemaFunctions.java @@ -68,7 +68,7 @@ public class SchemaFunctions { // Janino cannot infer type org.apache.drill.exec.record.MaterializedField materializedField = (org.apache.drill.exec.record.MaterializedField) columns.get(columnName); - org.apache.drill.common.types.TypeProtos.MajorType type = inputs[i + 1].getType(); // lgtm [java/index-out-of-bounds] + org.apache.drill.common.types.TypeProtos.MajorType type = inputs[i + 1].getType(); if (materializedField != null && !materializedField.getType().equals(type)) { org.apache.drill.common.types.TypeProtos.MinorType leastRestrictiveType = org.apache.drill.exec.resolver.TypeCastRules.getLeastRestrictiveType( @@ -85,7 +85,7 @@ public class SchemaFunctions { columns.put(columnName, clone); } else { if (type.getMinorType() == org.apache.drill.common.types.TypeProtos.MinorType.MAP) { - columns.put(columnName, inputs[i + 1].getField()); // lgtm [java/index-out-of-bounds] + columns.put(columnName, inputs[i + 1].getField()); } else { columns.put(columnName, org.apache.drill.exec.record.MaterializedField.create(columnName, type)); } diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/record/DeadBuf.java b/exec/java-exec/src/main/java/org/apache/drill/exec/record/DeadBuf.java index dcaf2262be..c3c3539de5 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/record/DeadBuf.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/record/DeadBuf.java @@ -917,7 +917,7 @@ public class DeadBuf extends ByteBuf { } @Override - public boolean equals(Object arg0) { //lgtm [java/unchecked-cast-in-equals] + public boolean equals(Object arg0) { return false; } diff --git a/exec/vector/src/main/java/org/apache/drill/exec/record/metadata/AbstractPropertied.java b/exec/vector/src/main/java/org/apache/drill/exec/record/metadata/AbstractPropertied.java index a04cdd9f4a..31bf83a690 100644 --- a/exec/vector/src/main/java/org/apache/drill/exec/record/metadata/AbstractPropertied.java +++ b/exec/vector/src/main/java/org/apache/drill/exec/record/metadata/AbstractPropertied.java @@ -120,7 +120,7 @@ public class AbstractPropertied implements Propertied { } @Override - public boolean equals(Object o) { //lgtm [java/unchecked-cast-in-equals] + public boolean equals(Object o) { if (o == this) { return true; } diff --git a/exec/vector/src/main/java/org/apache/drill/exec/util/JsonStringArrayList.java b/exec/vector/src/main/java/org/apache/drill/exec/util/JsonStringArrayList.java index 9af530f165..19ff04b12e 100644 --- a/exec/vector/src/main/java/org/apache/drill/exec/util/JsonStringArrayList.java +++ b/exec/vector/src/main/java/org/apache/drill/exec/util/JsonStringArrayList.java @@ -23,7 +23,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class JsonStringArrayList<E> extends ArrayList<E> { -//lgtm [java/inconsistent-equals-and-hashcode] + private static ObjectMapper mapper; static { diff --git a/exec/vector/src/main/java/org/apache/drill/exec/util/JsonStringHashMap.java b/exec/vector/src/main/java/org/apache/drill/exec/util/JsonStringHashMap.java index 8536822197..337858fa6c 100644 --- a/exec/vector/src/main/java/org/apache/drill/exec/util/JsonStringHashMap.java +++ b/exec/vector/src/main/java/org/apache/drill/exec/util/JsonStringHashMap.java @@ -30,7 +30,7 @@ import com.fasterxml.jackson.datatype.joda.JodaModule; * toString() method of the HashMap class to produce a JSON string instead */ public class JsonStringHashMap<K, V> extends LinkedHashMap<K, V> { - // lgtm [java/inconsistent-equals-and-hashcode] + private static final ObjectMapper mapper = new ObjectMapper() .registerModule(SerializationModule.getModule()) .registerModule(new JodaModule()); diff --git a/pom.xml b/pom.xml index fb6081e672..cd134b1623 100644 --- a/pom.xml +++ b/pom.xml @@ -695,7 +695,6 @@ <exclude>**/clientlib/y2038/*.h</exclude> <!-- All the files here should have MIT License --> <exclude>**/resources/parquet/**/*</exclude> <exclude>**/.asf.yaml</exclude> - <exclude>**/.lgtm.yml</exclude> <exclude>**/*.woff2</exclude> <exclude>**/*.ks</exclude> <exclude>**/*.pcap</exclude>