Fixed ASOF JOIN with DateTime64, updated test case for comparison.

This commit is contained in:
Vasily Nemkov 2020-11-14 09:19:08 +03:00
parent eb9604ecd0
commit fb712c4a4a
4 changed files with 11 additions and 5 deletions

View File

@ -39,6 +39,7 @@ void callWithType(TypeIndex which, F && f)
case TypeIndex::Decimal32: return f(Decimal32()); case TypeIndex::Decimal32: return f(Decimal32());
case TypeIndex::Decimal64: return f(Decimal64()); case TypeIndex::Decimal64: return f(Decimal64());
case TypeIndex::Decimal128: return f(Decimal128()); case TypeIndex::Decimal128: return f(Decimal128());
case TypeIndex::DateTime64: return f(DateTime64());
default: default:
break; break;
} }
@ -153,6 +154,9 @@ std::optional<TypeIndex> AsofRowRefs::getTypeSize(const IColumn & asof_column, s
case TypeIndex::Decimal128: case TypeIndex::Decimal128:
size = sizeof(Decimal128); size = sizeof(Decimal128);
return idx; return idx;
case TypeIndex::DateTime64:
size = sizeof(DateTime64);
return idx;
default: default:
break; break;
} }

View File

@ -228,7 +228,8 @@ public:
Entry<Float64>::LookupPtr, Entry<Float64>::LookupPtr,
Entry<Decimal32>::LookupPtr, Entry<Decimal32>::LookupPtr,
Entry<Decimal64>::LookupPtr, Entry<Decimal64>::LookupPtr,
Entry<Decimal128>::LookupPtr>; Entry<Decimal128>::LookupPtr,
Entry<DateTime64>::LookupPtr>;
AsofRowRefs() {} AsofRowRefs() {}
AsofRowRefs(TypeIndex t); AsofRowRefs(TypeIndex t);

View File

@ -1,3 +1,3 @@
2019-09-16 19:20:33.123000 2019-09-16 19:20:33.123 0 1 1 1 0 2015-05-18 07:40:29.123456 2019-09-16 19:20:33.123 0 0 0 1 1 1
2015-05-18 07:40:29.123456 2019-09-16 19:20:33.123 0 0 0 1 1 2019-09-16 19:20:33.123000 2019-09-16 19:20:33.123 0 1 1 1 0 0
2019-09-16 19:20:33.123456 2015-05-18 07:40:29.123 1 1 0 0 0 2019-09-16 19:20:33.123456 2015-05-18 07:40:29.123 1 1 0 0 0 1

View File

@ -14,7 +14,8 @@ SELECT
dt6 >= dt3, dt6 >= dt3,
dt6 = dt3, dt6 = dt3,
dt6 <= dt3, dt6 <= dt3,
dt6 < dt3 dt6 < dt3,
dt6 != dt3
FROM datetime64_cmp FROM datetime64_cmp
ORDER BY ORDER BY
dt6, dt3; dt6, dt3;