diff --git a/core/src/main/java/com/nfsdb/ql/ops/FunctionFactories.java b/core/src/main/java/com/nfsdb/ql/ops/FunctionFactories.java index d9e492bfbcb69eafead107f16e2e47c7c6eade6e..a9511510059364cc08fcf68c7a29d4654d338f0f 100644 --- a/core/src/main/java/com/nfsdb/ql/ops/FunctionFactories.java +++ b/core/src/main/java/com/nfsdb/ql/ops/FunctionFactories.java @@ -137,10 +137,35 @@ public final class FunctionFactories { break; case STRING: if (vc.getFlyweightStr(null) == null) { + ColumnType t = sig.paramTypes.getQuick(0); if (Chars.equals(sig.name, '=')) { - return StrEqualsNullOperator.FACTORY; + switch (t) { + case DOUBLE: + return DoubleEqualsNanOperator.FACTORY; + case STRING: + return StrEqualsNullOperator.FACTORY; + case INT: + return IntEqualsNaNOperator.FACTORY; + case LONG: + case DATE: + return LongEqualsNaNOperator.FACTORY; + default: + break; + } } else if (Chars.equals(sig.name, "!=")) { - return StrNotEqualsNullOperator.FACTORY; + switch (t) { + case DOUBLE: + return DoubleNotEqualsNanOperator.FACTORY; + case STRING: + return StrNotEqualsNullOperator.FACTORY; + case INT: + return IntNotEqualsNaNOperator.FACTORY; + case LONG: + case DATE: + return LongNotEqualsNaNOperator.FACTORY; + default: + break; + } } } break; diff --git a/core/src/main/java/com/nfsdb/ql/parser/VirtualColumnBuilder.java b/core/src/main/java/com/nfsdb/ql/parser/VirtualColumnBuilder.java index f9e294ba5f7648cc12996bd16dbdab72864690d2..d05a3212fda603960923f9e97dba47a45fa4b935 100644 --- a/core/src/main/java/com/nfsdb/ql/parser/VirtualColumnBuilder.java +++ b/core/src/main/java/com/nfsdb/ql/parser/VirtualColumnBuilder.java @@ -1,24 +1,24 @@ /******************************************************************************* - * ___ _ ____ ____ - * / _ \ _ _ ___ ___| |_| _ \| __ ) - * | | | | | | |/ _ \/ __| __| | | | _ \ - * | |_| | |_| | __/\__ \ |_| |_| | |_) | - * \__\_\\__,_|\___||___/\__|____/|____/ - * + * ___ _ ____ ____ + * / _ \ _ _ ___ ___| |_| _ \| __ ) + * | | | | | | |/ _ \/ __| __| | | | _ \ + * | |_| | |_| | __/\__ \ |_| |_| | |_) | + * \__\_\\__,_|\___||___/\__|____/|____/ + *
* Copyright (C) 2014-2016 Appsicle - * + *
* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. - * + *
* This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + *
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see
* As a special exception, the copyright holders give permission to link the
* code of portions of this program with the OpenSSL library under certain
* conditions as described in each individual source file and distribute
@@ -30,7 +30,6 @@
* delete this exception statement from your version. If you delete this
* exception statement from all source files in the program, then also delete
* it in the license file.
- *
******************************************************************************/
package com.nfsdb.ql.parser;
@@ -64,18 +63,10 @@ class VirtualColumnBuilder implements PostOrderTreeTraversalAlgo.Visitor {
private CharSequenceIntHashMap columnNameHistogram;
private CharSequenceObjHashMap