SQL: More polish

Original commit: elastic/x-pack-elasticsearch@cedbad466b
This commit is contained in:
Costin Leau 2018-02-02 18:01:51 +02:00
parent b5dd4c649a
commit bda97c6e59
4 changed files with 16 additions and 18 deletions

View File

@ -36,11 +36,11 @@ import javax.sql.DataSource;
* JDBC carries a lot of legacy conventions, logging being one of them - in JDBC logging was expected to
* be to System.Err/Out since there were no logging frameworks at the time.
* This didn't work so the API was changed through {@link DriverManager#getLogStream()} however that also had issues
* being global and not working well with encoding (hence why {@link DriverManager#getLogWriter()} was introduced)
* being global and not working well with encoding (hence why {@link DriverManager#getLogWriter()} was introduced)
* and was changed again through {@link DataSource#getLogWriter()}.
* However by then the damage was done and most drivers don't use either and have their own logging implementation.
*
* This class tries to cater to both audience - use the legacy, Writer way if needed though strive to use the
* This class tries to cater to both audiences - use the legacy, Writer way if needed though strive to use the
* proper typical approach, that of specifying intention and output (file) in the URL.
*
* For this reason the {@link System#out} and {@link System#err} are being refered in this class though are used only

View File

@ -1,21 +1,20 @@
/*
* ELASTICSEARCH CONFIDENTIAL
* __________________
*
* [2017] Elasticsearch Incorporated. All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Elasticsearch Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Elasticsearch Incorporated
* and its suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Elasticsearch Incorporated.
* Licensed 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.
*/
/** Fork from Presto Parser - significantly trimmed down and adjusted for ES */
/** Fork of Facebook Presto Parser - significantly trimmed down and adjusted for ES */
/** presto-parser/src/main/antlr4/com/facebook/presto/sql/parser/SqlBase.g4 grammar */
grammar SqlBase;

View File

@ -86,7 +86,6 @@ import org.elasticsearch.xpack.sql.querydsl.query.TermQuery;
import org.elasticsearch.xpack.sql.querydsl.query.WildcardQuery;
import org.elasticsearch.xpack.sql.tree.Location;
import org.elasticsearch.xpack.sql.type.DataType;
import org.elasticsearch.xpack.sql.type.DataTypes;
import org.elasticsearch.xpack.sql.util.Check;
import org.elasticsearch.xpack.sql.util.ReflectionUtils;
@ -830,7 +829,7 @@ abstract class QueryTranslator {
abstract static class AggTranslator<F extends Function> {
private final Class<F> typeToken = ReflectionUtils.detectSuperTypeForRuleLike(getClass());
private final Class<?> typeToken = ReflectionUtils.detectSuperTypeForRuleLike(getClass());
@SuppressWarnings("unchecked")
public final LeafAgg apply(String id, String parent, Function f) {

View File

@ -66,7 +66,7 @@ public class ReflectionUtils {
throw new SqlIllegalArgumentException("Unexpected class structure for class {}", c);
}
// remove packaging from the name - strategy used for naming rules by default
// remove packaging from the name - strategy used for naming rules by default
public static String ruleLikeNaming(Class<?> c) {
String className = c.getName();
int parentPackage = className.lastIndexOf(".");