[Regression](datev2) Add test cases for datev2/datetimev2 (#11831)
This commit is contained in:
@ -154,7 +154,7 @@ bool DeleteHandler::is_condition_value_valid(const TabletColumn& column,
|
||||
case OLAP_FIELD_TYPE_DATETIME:
|
||||
case OLAP_FIELD_TYPE_DATEV2:
|
||||
case OLAP_FIELD_TYPE_DATETIMEV2:
|
||||
return valid_datetime(value_str);
|
||||
return valid_datetime(value_str, column.frac());
|
||||
case OLAP_FIELD_TYPE_BOOL:
|
||||
return valid_bool(value_str);
|
||||
default:
|
||||
|
||||
@ -741,7 +741,7 @@ bool valid_decimal(const string& value_str, const uint32_t precision, const uint
|
||||
}
|
||||
}
|
||||
|
||||
bool valid_datetime(const string& value_str) {
|
||||
bool valid_datetime(const string& value_str, const uint32_t scale) {
|
||||
const char* datetime_pattern =
|
||||
"((?:\\d){4})-((?:\\d){2})-((?:\\d){2})[ ]*"
|
||||
"(((?:\\d){2}):((?:\\d){2}):((?:\\d){2})([.]*((?:\\d){0,6})))?";
|
||||
@ -787,7 +787,14 @@ bool valid_datetime(const string& value_str) {
|
||||
}
|
||||
if (what[8].length()) {
|
||||
if (what[9].str().size() > 6) {
|
||||
LOG(WARNING) << "invalid microsecond. [second=" << second << "]";
|
||||
LOG(WARNING) << "invalid microsecond. [microsecond=" << what[9].str() << "]";
|
||||
return false;
|
||||
}
|
||||
|
||||
long ms = strtol(what[9].str().c_str(), nullptr, 10);
|
||||
if (ms % ((long)std::pow(10, 6 - scale)) != 0) {
|
||||
LOG(WARNING) << "invalid microsecond. [microsecond=" << what[9].str()
|
||||
<< ", scale = " << scale << "]";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -268,7 +268,7 @@ bool valid_decimal(const std::string& value_str, const uint32_t precision, const
|
||||
|
||||
// Validate for date/datetime roughly. The format is 'yyyy-MM-dd HH:mm:ss'
|
||||
// TODO: support 'yyyy-MM-dd HH:mm:ss.SSS'
|
||||
bool valid_datetime(const std::string& value_str);
|
||||
bool valid_datetime(const std::string& value_str, const uint32_t scale);
|
||||
|
||||
bool valid_bool(const std::string& value_str);
|
||||
|
||||
|
||||
@ -469,9 +469,9 @@ public:
|
||||
arguments[0].type->get_name(), get_name());
|
||||
}
|
||||
} else {
|
||||
if (!WhichDataType(arguments[0].type).is_date_time() ||
|
||||
!WhichDataType(arguments[0].type).is_date_time_v2() ||
|
||||
!WhichDataType(arguments[2].type).is_string()) {
|
||||
if (!WhichDataType(remove_nullable(arguments[0].type)).is_date_time() ||
|
||||
!WhichDataType(remove_nullable(arguments[0].type)).is_date_time_v2() ||
|
||||
!WhichDataType(remove_nullable(arguments[2].type)).is_string()) {
|
||||
LOG(FATAL) << fmt::format(
|
||||
"Function {} supports 2 or 3 arguments. The 1st argument must be of type "
|
||||
"Date or DateTime. The 2nd argument must be number. The 3rd argument "
|
||||
@ -487,10 +487,10 @@ public:
|
||||
|
||||
Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
|
||||
size_t result, size_t input_rows_count) override {
|
||||
const IDataType* first_arg_type = block.get_by_position(arguments[0]).type.get();
|
||||
const IDataType* second_arg_type = block.get_by_position(arguments[1]).type.get();
|
||||
WhichDataType which1(first_arg_type);
|
||||
WhichDataType which2(second_arg_type);
|
||||
const auto& first_arg_type = block.get_by_position(arguments[0]).type;
|
||||
const auto& second_arg_type = block.get_by_position(arguments[1]).type;
|
||||
WhichDataType which1(remove_nullable(first_arg_type));
|
||||
WhichDataType which2(remove_nullable(second_arg_type));
|
||||
|
||||
if (which1.is_date() && which2.is_date()) {
|
||||
return DateTimeAddIntervalImpl<DataTypeDate::FieldType, Transform,
|
||||
@ -603,7 +603,7 @@ struct CurrentDateTimeImpl {
|
||||
static constexpr auto name = FunctionName::name;
|
||||
static Status execute(FunctionContext* context, Block& block, size_t result,
|
||||
size_t input_rows_count) {
|
||||
WhichDataType which(block.get_by_position(result).type);
|
||||
WhichDataType which(remove_nullable(block.get_by_position(result).type));
|
||||
if (which.is_date_time_v2()) {
|
||||
return executeImpl<DateV2Value<DateTimeV2ValueType>, UInt64>(context, block, result,
|
||||
input_rows_count);
|
||||
@ -721,7 +721,7 @@ struct UtcTimestampImpl {
|
||||
static constexpr auto name = "utc_timestamp";
|
||||
static Status execute(FunctionContext* context, Block& block, size_t result,
|
||||
size_t input_rows_count) {
|
||||
WhichDataType which(block.get_by_position(result).type);
|
||||
WhichDataType which(remove_nullable(block.get_by_position(result).type));
|
||||
if (which.is_date_time_v2()) {
|
||||
return executeImpl<DateV2Value<DateTimeV2ValueType>, UInt64>(context, block, result,
|
||||
input_rows_count);
|
||||
|
||||
@ -1754,7 +1754,7 @@ bool DateV2Value<T>::from_date_str(const char* date_str, int len, int scale) {
|
||||
|
||||
int field_idx = 0;
|
||||
int field_len = year_len;
|
||||
while (ptr < end && isdigit(*ptr) && field_idx <= MAX_DATE_PARTS) {
|
||||
while (ptr < end && isdigit(*ptr) && field_idx < MAX_DATE_PARTS) {
|
||||
const char* start = ptr;
|
||||
int temp_val = 0;
|
||||
bool scan_to_delim = (!is_interval_format) && (field_idx != 6);
|
||||
@ -1767,6 +1767,7 @@ bool DateV2Value<T>::from_date_str(const char* date_str, int len, int scale) {
|
||||
if constexpr (is_datetime) {
|
||||
if (scale >= 0) {
|
||||
temp_val /= std::pow(10, 6 - scale);
|
||||
temp_val *= std::pow(10, 6 - scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1785,7 +1786,6 @@ bool DateV2Value<T>::from_date_str(const char* date_str, int len, int scale) {
|
||||
if (field_idx == 2 && *ptr == 'T') {
|
||||
// YYYYMMDDTHHMMDD, skip 'T' and continue
|
||||
ptr++;
|
||||
field_idx++;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -2301,7 +2301,7 @@ int32_t DateV2Value<T>::to_buffer(char* buffer, int scale) const {
|
||||
/* Second */
|
||||
*buffer++ = (char)('0' + (date_v2_value_.second_ / 10));
|
||||
*buffer++ = (char)('0' + (date_v2_value_.second_ % 10));
|
||||
if (scale != 0 && date_v2_value_.microsecond_ > 0) {
|
||||
if (scale < 0 && date_v2_value_.microsecond_ > 0) {
|
||||
*buffer++ = '.';
|
||||
/* Microsecond */
|
||||
uint32_t ms = date_v2_value_.microsecond_;
|
||||
@ -2310,6 +2310,15 @@ int32_t DateV2Value<T>::to_buffer(char* buffer, int scale) const {
|
||||
*buffer++ = (char)('0' + (ms / std::pow(10, 5 - i)));
|
||||
ms %= (uint32_t)std::pow(10, 5 - i);
|
||||
}
|
||||
} else if (scale > 0) {
|
||||
*buffer++ = '.';
|
||||
/* Microsecond */
|
||||
uint32_t ms = date_v2_value_.microsecond_;
|
||||
int ms_width = std::min(6, scale);
|
||||
for (int i = 0; i < ms_width; i++) {
|
||||
*buffer++ = (char)('0' + (ms / std::pow(10, 5 - i)));
|
||||
ms %= (uint32_t)std::pow(10, 5 - i);
|
||||
}
|
||||
}
|
||||
}
|
||||
return buffer - start;
|
||||
|
||||
@ -235,7 +235,6 @@ Status VMysqlResultWriter::_add_one_column(const ColumnPtr& column_ptr,
|
||||
buf_ret = _buffer.push_string(buf, pos - buf - 1);
|
||||
}
|
||||
if constexpr (type == TYPE_DATETIMEV2) {
|
||||
// TODO: use correct scale here
|
||||
char buf[64];
|
||||
auto time_num = data[i];
|
||||
doris::vectorized::DateV2Value<DateTimeV2ValueType> date_val;
|
||||
|
||||
@ -431,9 +431,6 @@ public class DateLiteral extends LiteralExpr {
|
||||
minute = getOrDefault(dateTime, ChronoField.MINUTE_OF_HOUR, 0);
|
||||
second = getOrDefault(dateTime, ChronoField.SECOND_OF_MINUTE, 0);
|
||||
microsecond = getOrDefault(dateTime, ChronoField.MICRO_OF_SECOND, 0);
|
||||
if (type.isDatetimeV2()) {
|
||||
this.roundFloor(((ScalarType) type).getScalarScale());
|
||||
}
|
||||
this.type = type;
|
||||
} catch (Exception ex) {
|
||||
throw new AnalysisException("date literal [" + s + "] is invalid: " + ex.getMessage());
|
||||
@ -526,12 +523,14 @@ public class DateLiteral extends LiteralExpr {
|
||||
if (type.isDate() || type.isDateV2()) {
|
||||
return String.format("%04d-%02d-%02d", year, month, day);
|
||||
} else if (type.isDatetimeV2()) {
|
||||
long ms = Double.valueOf(microsecond / (int) (Math.pow(10, 6 - ((ScalarType) type).getScalarScale()))
|
||||
* (Math.pow(10, 6 - ((ScalarType) type).getScalarScale()))).longValue();
|
||||
String tmp = String.format("%04d-%02d-%02d %02d:%02d:%02d",
|
||||
year, month, day, hour, minute, second);
|
||||
if (microsecond == 0) {
|
||||
if (ms == 0) {
|
||||
return tmp;
|
||||
}
|
||||
return tmp + String.format(".%06d", microsecond);
|
||||
return tmp + String.format(".%06d", ms);
|
||||
} else {
|
||||
return String.format("%04d-%02d-%02d %02d:%02d:%02d", year, month, day, hour, minute, second);
|
||||
}
|
||||
@ -542,13 +541,23 @@ public class DateLiteral extends LiteralExpr {
|
||||
long remain = Double.valueOf(microsecond % (Math.pow(10, 6 - newScale))).longValue();
|
||||
if (remain != 0) {
|
||||
microsecond = Double.valueOf((microsecond + (Math.pow(10, 6 - newScale)))
|
||||
/ (Math.pow(10, 6 - newScale)) * (Math.pow(10, 6 - newScale))).longValue();
|
||||
/ (int) (Math.pow(10, 6 - newScale)) * (Math.pow(10, 6 - newScale))).longValue();
|
||||
}
|
||||
if (microsecond > MAX_MICROSECOND) {
|
||||
microsecond %= microsecond;
|
||||
DateLiteral result = this.plusSeconds(1);
|
||||
this.second = result.second;
|
||||
this.minute = result.minute;
|
||||
this.hour = result.hour;
|
||||
this.day = result.day;
|
||||
this.month = result.month;
|
||||
this.year = result.year;
|
||||
}
|
||||
type = ScalarType.createDatetimeV2Type(newScale);
|
||||
}
|
||||
|
||||
public void roundFloor(int newScale) {
|
||||
microsecond = Double.valueOf(microsecond / (Math.pow(10, 6 - newScale))
|
||||
microsecond = Double.valueOf(microsecond / (int) (Math.pow(10, 6 - newScale))
|
||||
* (Math.pow(10, 6 - newScale))).longValue();
|
||||
type = ScalarType.createDatetimeV2Type(newScale);
|
||||
}
|
||||
@ -580,6 +589,9 @@ public class DateLiteral extends LiteralExpr {
|
||||
|
||||
@Override
|
||||
protected void toThrift(TExprNode msg) {
|
||||
if (type.isDatetimeV2()) {
|
||||
this.roundFloor(((ScalarType) type).getScalarScale());
|
||||
}
|
||||
msg.node_type = TExprNodeType.DATE_LITERAL;
|
||||
msg.date_literal = new TDateLiteral(getStringValue());
|
||||
}
|
||||
@ -870,11 +882,11 @@ public class DateLiteral extends LiteralExpr {
|
||||
return new DateLiteral(getTimeFormatter().plusHours(hour), type);
|
||||
}
|
||||
|
||||
public DateLiteral plusMinutes(int minute) throws AnalysisException {
|
||||
public DateLiteral plusMinutes(int minute) {
|
||||
return new DateLiteral(getTimeFormatter().plusMinutes(minute), type);
|
||||
}
|
||||
|
||||
public DateLiteral plusSeconds(int second) throws AnalysisException {
|
||||
public DateLiteral plusSeconds(int second) {
|
||||
return new DateLiteral(getTimeFormatter().plusSeconds(second), type);
|
||||
}
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
package org.apache.doris.analysis;
|
||||
|
||||
import org.apache.doris.catalog.Type;
|
||||
import org.apache.doris.common.AnalysisException;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
@ -42,10 +43,10 @@ public class DefaultValueExprDef {
|
||||
* generate a FunctionCallExpr
|
||||
* @return FunctionCallExpr of exprName
|
||||
*/
|
||||
public FunctionCallExpr getExpr() {
|
||||
public FunctionCallExpr getExpr(Type type) {
|
||||
FunctionCallExpr expr = new FunctionCallExpr(exprName, new FunctionParams(null));
|
||||
try {
|
||||
expr.analyzeImplForDefaultValue();
|
||||
expr.analyzeImplForDefaultValue(type);
|
||||
} catch (AnalysisException e) {
|
||||
LOG.warn("analyzeImplForDefaultValue fail: {}", e);
|
||||
}
|
||||
|
||||
@ -827,9 +827,10 @@ public class FunctionCallExpr extends Expr {
|
||||
* to generate a builtinFunction.
|
||||
* @throws AnalysisException
|
||||
*/
|
||||
public void analyzeImplForDefaultValue() throws AnalysisException {
|
||||
public void analyzeImplForDefaultValue(Type type) throws AnalysisException {
|
||||
fn = getBuiltinFunction(fnName.getFunction(), new Type[0], Function.CompareMode.IS_NONSTRICT_SUPERTYPE_OF);
|
||||
type = ScalarType.getDefaultDateType(fn.getReturnType());
|
||||
fn.setReturnType(type);
|
||||
this.type = type;
|
||||
for (int i = 0; i < children.size(); ++i) {
|
||||
if (getChild(i).getType().isNull()) {
|
||||
uncheckedCastChild(Type.BOOLEAN, i);
|
||||
@ -936,6 +937,9 @@ public class FunctionCallExpr extends Expr {
|
||||
childTypes[2] = assignmentCompatibleType;
|
||||
fn = getBuiltinFunction(fnName.getFunction(), childTypes,
|
||||
Function.CompareMode.IS_NONSTRICT_SUPERTYPE_OF);
|
||||
if (assignmentCompatibleType.isDatetimeV2()) {
|
||||
fn.setReturnType(assignmentCompatibleType);
|
||||
}
|
||||
} else if (AggregateFunction.SUPPORT_ORDER_BY_AGGREGATE_FUNCTION_NAME_SET.contains(
|
||||
fnName.getFunction().toLowerCase())) {
|
||||
// order by elements add as child like windows function. so if we get the
|
||||
@ -995,6 +999,15 @@ public class FunctionCallExpr extends Expr {
|
||||
throw new AnalysisException(getFunctionNotFoundError(collectChildReturnTypes()));
|
||||
}
|
||||
|
||||
if (fn.getArgs().length == children.size() && fn.getArgs().length == 1) {
|
||||
if (fn.getArgs()[0].isDatetimeV2() && children.get(0).getType().isDatetimeV2()) {
|
||||
fn.setArgType(children.get(0).getType(), 0);
|
||||
if (fn.getReturnType().isDatetimeV2()) {
|
||||
fn.setReturnType(children.get(0).getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fnName.getFunction().equalsIgnoreCase("from_unixtime")
|
||||
|| fnName.getFunction().equalsIgnoreCase("date_format")) {
|
||||
// if has only one child, it has default time format: yyyy-MM-dd HH:mm:ss.SSSSSS
|
||||
|
||||
@ -319,7 +319,7 @@ public class Column implements Writable {
|
||||
return defaultValueLiteral;
|
||||
}
|
||||
if (defaultValueExprDef != null) {
|
||||
return defaultValueExprDef.getExpr();
|
||||
return defaultValueExprDef.getExpr(type);
|
||||
}
|
||||
Expr result = defaultValueLiteral.castTo(getType());
|
||||
result.checkValueValid();
|
||||
|
||||
@ -180,6 +180,10 @@ public class Function implements Writable {
|
||||
this.retType = type;
|
||||
}
|
||||
|
||||
public void setArgType(Type type, int i) {
|
||||
argTypes[i] = type;
|
||||
}
|
||||
|
||||
public Type[] getArgs() {
|
||||
return argTypes;
|
||||
}
|
||||
|
||||
@ -986,6 +986,12 @@ public class ScalarType extends Type {
|
||||
PrimitiveType largerType =
|
||||
(t1.type.ordinal() > t2.type.ordinal() ? t1.type : t2.type);
|
||||
PrimitiveType result = null;
|
||||
if (t1.isDatetimeV2() && t2.isDatetimeV2()) {
|
||||
return t1.scale > t2.scale ? t1 : t2;
|
||||
}
|
||||
if ((t1.isDatetimeV2() || t1.isDateV2()) && (t1.isDatetimeV2() || t1.isDateV2())) {
|
||||
return t1.isDatetimeV2() ? t1 : t2;
|
||||
}
|
||||
if (strict) {
|
||||
result = strictCompatibilityMatrix[smallerType.ordinal()][largerType.ordinal()];
|
||||
}
|
||||
|
||||
@ -1547,6 +1547,8 @@ public abstract class Type {
|
||||
return t1;
|
||||
} else if (t2.isDatetimeV2()) {
|
||||
return t2;
|
||||
} else if (t2.isDateV2() || t1.isDateV2()) {
|
||||
return Type.DATETIMEV2;
|
||||
} else {
|
||||
return ScalarType.getDefaultDateType(Type.DATETIME);
|
||||
}
|
||||
|
||||
@ -591,10 +591,10 @@ public class DeleteHandler implements Writable {
|
||||
Type.fromPrimitiveType(column.getDataType())));
|
||||
} else if (column.getDataType() == PrimitiveType.DATETIMEV2) {
|
||||
DateLiteral dateLiteral = new DateLiteral(value,
|
||||
ScalarType.createDecimalType(ScalarType.MAX_DATETIMEV2_SCALE));
|
||||
ScalarType.createDatetimeV2Type(ScalarType.MAX_DATETIMEV2_SCALE));
|
||||
value = dateLiteral.getStringValue();
|
||||
binaryPredicate.setChild(1, LiteralExpr.create(value,
|
||||
ScalarType.createDecimalType(ScalarType.MAX_DATETIMEV2_SCALE)));
|
||||
ScalarType.createDatetimeV2Type(ScalarType.MAX_DATETIMEV2_SCALE)));
|
||||
}
|
||||
LiteralExpr.create(value, Type.fromPrimitiveType(column.getDataType()));
|
||||
} catch (AnalysisException e) {
|
||||
|
||||
@ -99,44 +99,41 @@ public class RoundLiteralInBinaryPredicatesRule implements ExprRewriteRule {
|
||||
Expr expr1 = expr.getChild(1);
|
||||
if (expr0.getType().isDatetimeV2() && expr1 instanceof DateLiteral && expr1.getType().isDatetimeV2()) {
|
||||
DateLiteral literal = (DateLiteral) expr1;
|
||||
if (((ScalarType) expr0.getType()).getScalarScale()
|
||||
< ((ScalarType) expr1.getType()).getScalarScale()) {
|
||||
switch (op) {
|
||||
case EQ: {
|
||||
long originValue = literal.getMicrosecond();
|
||||
literal.roundCeiling(((ScalarType) expr0.getType()).getScalarScale());
|
||||
if (literal.getMicrosecond() == originValue) {
|
||||
expr.setChild(1, literal);
|
||||
return expr;
|
||||
} else {
|
||||
return new BoolLiteral(false);
|
||||
}
|
||||
}
|
||||
case NE: {
|
||||
long originValue = literal.getMicrosecond();
|
||||
literal.roundCeiling(((ScalarType) expr0.getType()).getScalarScale());
|
||||
if (literal.getMicrosecond() == originValue) {
|
||||
expr.setChild(1, literal);
|
||||
return expr;
|
||||
} else {
|
||||
return new BoolLiteral(true);
|
||||
}
|
||||
}
|
||||
case GT:
|
||||
case LE: {
|
||||
literal.roundFloor(((ScalarType) expr0.getType()).getScalarScale());
|
||||
switch (op) {
|
||||
case EQ: {
|
||||
long originValue = literal.getMicrosecond();
|
||||
literal.roundCeiling(((ScalarType) expr0.getType()).getScalarScale());
|
||||
if (literal.getMicrosecond() == originValue) {
|
||||
expr.setChild(1, literal);
|
||||
return expr;
|
||||
} else {
|
||||
return new BoolLiteral(false);
|
||||
}
|
||||
case LT:
|
||||
case GE: {
|
||||
literal.roundCeiling(((ScalarType) expr0.getType()).getScalarScale());
|
||||
expr.setChild(1, literal);
|
||||
return expr;
|
||||
}
|
||||
default:
|
||||
return expr;
|
||||
}
|
||||
case NE: {
|
||||
long originValue = literal.getMicrosecond();
|
||||
literal.roundCeiling(((ScalarType) expr0.getType()).getScalarScale());
|
||||
if (literal.getMicrosecond() == originValue) {
|
||||
expr.setChild(1, literal);
|
||||
return expr;
|
||||
} else {
|
||||
return new BoolLiteral(true);
|
||||
}
|
||||
}
|
||||
case GT:
|
||||
case LE: {
|
||||
literal.roundFloor(((ScalarType) expr0.getType()).getScalarScale());
|
||||
expr.setChild(1, literal);
|
||||
return expr;
|
||||
}
|
||||
case LT:
|
||||
case GE: {
|
||||
literal.roundCeiling(((ScalarType) expr0.getType()).getScalarScale());
|
||||
expr.setChild(1, literal);
|
||||
return expr;
|
||||
}
|
||||
default:
|
||||
return expr;
|
||||
}
|
||||
}
|
||||
return expr;
|
||||
|
||||
@ -48,7 +48,7 @@ testDirectories = ""
|
||||
// this groups will not be executed
|
||||
excludeGroups = ""
|
||||
// this suites will not be executed
|
||||
excludeSuites = "test_create_table_with_bloom_filter"
|
||||
excludeSuites = ""
|
||||
// this directories will not be executed
|
||||
excludeDirectories = ""
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
-- This file is automatically generated. You should know what you did if you want to edit this
|
||||
-- !select_tb --
|
||||
1 2 4 8 50string 500varchar c 65535varchar 0 123456789012345678.123456789 2013-12-01 1900-01-01T00:00 1 2 4 8 50string 500varchar_replace c 65535varchar 12345678901234.123456 123456789012345678.123456789 1900-01-01 1900-01-01 1900-01-01 1900-01-01T00:00 1900-01-01T00:00 1900-01-01T00:00 0.4 0.8
|
||||
1 2 4 8 50string 500varchar c 65535varchar 0 123456789012345678.123456789 2013-12-01 1900-01-01T00:00 2013-12-01 1900-01-01T00:00 1900-01-01T00:00:00.111 1900-01-01T00:00:00.111111 1 2 4 8 50string 500varchar_replace c 65535varchar 12345678901234.123456 123456789012345678.123456789 1900-01-01 1900-01-01 1900-01-01 1900-01-01T00:00 1900-01-01T00:00 1900-01-01T00:00 2013-12-01 2013-12-01 2013-12-01 1900-01-01T00:00 1900-01-01T00:00 1900-01-01T00:00 1900-01-01T00:00:00.111 1900-01-01T00:00:00.111 1900-01-01T00:00:00.111 1900-01-01T00:00:00.111111 1900-01-01T00:00:00.111111 1900-01-01T00:00:00.111111 0.4 0.8
|
||||
|
||||
-- !desc_tb --
|
||||
tinyint_key TINYINT No true \N
|
||||
@ -15,6 +15,10 @@ decimal_key DECIMAL(20,6) No true \N BLOOM_FILTER
|
||||
decimal_most_key DECIMAL(27,9) No true \N BLOOM_FILTER
|
||||
date_key DATE No true \N BLOOM_FILTER
|
||||
datetime_key DATETIME No true \N BLOOM_FILTER
|
||||
datev2_key DATEV2 No true \N BLOOM_FILTER
|
||||
datetimev2_key_1 DATETIMEV2(0) No true \N BLOOM_FILTER
|
||||
datetimev2_key_2 DATETIMEV2(3) No true \N BLOOM_FILTER
|
||||
datetimev2_key_3 DATETIMEV2(6) No true \N BLOOM_FILTER
|
||||
tinyint_value TINYINT No false \N SUM
|
||||
smallint_value SMALLINT No false \N SUM
|
||||
int_value INT No false \N SUM
|
||||
@ -31,6 +35,18 @@ date_value_min DATE No false \N MIN
|
||||
datetime_value_max DATETIME No false \N MAX
|
||||
datetime_value_replace DATETIME No false \N REPLACE
|
||||
datetime_value_min DATETIME No false \N MIN
|
||||
datev2_value_max DATEV2 No false \N MAX
|
||||
datev2_value_replace DATEV2 No false \N REPLACE
|
||||
datev2_value_min DATEV2 No false \N MIN
|
||||
datetimev2_value_1_max DATETIMEV2(0) No false \N MAX
|
||||
datetimev2_value_1_replace DATETIMEV2(0) No false \N REPLACE
|
||||
datetimev2_value_1_min DATETIMEV2(0) No false \N MIN
|
||||
datetimev2_value_2_max DATETIMEV2(3) No false \N MAX
|
||||
datetimev2_value_2_replace DATETIMEV2(3) No false \N REPLACE
|
||||
datetimev2_value_2_min DATETIMEV2(3) No false \N MIN
|
||||
datetimev2_value_3_max DATETIMEV2(6) No false \N MAX
|
||||
datetimev2_value_3_replace DATETIMEV2(6) No false \N REPLACE
|
||||
datetimev2_value_3_min DATETIMEV2(6) No false \N MIN
|
||||
float_value FLOAT No false \N SUM
|
||||
double_value DOUBLE No false \N SUM
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
-- This file is automatically generated. You should know what you did if you want to edit this
|
||||
-- !select_default --
|
||||
1 2017-10-01 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2020-01-02T00:00 2 31 19 \N \N
|
||||
2 2017-10-01 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2020-01-03T00:00 2 32 20 \N \N
|
||||
3 2017-10-01 Beijing 10 1 \N 2020-01-04T00:00 2020-01-05T00:00 3 34 20 \N \N
|
||||
4 2017-10-01 Beijing 10 1 \N \N 2020-01-05T00:00 1 34 20 \N \N
|
||||
1 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2017-10-01T11:11:11.160 2017-10-01T11:11:11.100111 2020-01-02T00:00 2 31 19 \N \N
|
||||
2 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2017-10-01T11:11:11.140 2017-10-01T11:11:11.120111 2020-01-03T00:00 2 32 20 \N \N
|
||||
3 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 \N 2020-01-04T00:00 \N 2017-10-01T11:11:11.150111 2020-01-05T00:00 3 34 20 \N \N
|
||||
4 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 \N \N \N \N 2020-01-05T00:00 1 34 20 \N \N
|
||||
|
||||
-- !select_default2 --
|
||||
1 2017-10-01 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2020-01-02T00:00 2 31 19 \N \N
|
||||
2 2017-10-01 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2020-01-03T00:00 2 32 20 \N \N
|
||||
3 2017-10-01 Beijing 10 1 \N 2020-01-04T00:00 2020-01-05T00:00 3 34 20 \N \N
|
||||
4 2017-10-01 Beijing 10 1 \N \N 2020-01-05T00:00 1 34 20 \N \N
|
||||
1 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2017-10-01T11:11:11.160 2017-10-01T11:11:11.100111 2020-01-02T00:00 2 31 19 \N \N
|
||||
2 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2017-10-01T11:11:11.140 2017-10-01T11:11:11.120111 2020-01-03T00:00 2 32 20 \N \N
|
||||
3 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 \N 2020-01-04T00:00 \N 2017-10-01T11:11:11.150111 2020-01-05T00:00 3 34 20 \N \N
|
||||
4 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 \N \N \N \N 2020-01-05T00:00 1 34 20 \N \N
|
||||
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
-- This file is automatically generated. You should know what you did if you want to edit this
|
||||
-- !select_default --
|
||||
1 2017-10-01 Beijing 10 1 2020-01-01T00:00 2020-01-01T00:00 2020-01-01T00:00 1 30 20
|
||||
1 2017-10-01 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2020-01-02T00:00 1 31 19
|
||||
2 2017-10-01 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2020-01-02T00:00 1 31 21
|
||||
2 2017-10-01 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2020-01-03T00:00 1 32 20
|
||||
3 2017-10-01 Beijing 10 1 \N \N 2020-01-05T00:00 1 34 20
|
||||
3 2017-10-01 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2020-01-03T00:00 1 32 22
|
||||
3 2017-10-01 Beijing 10 1 2020-01-04T00:00 2020-01-04T00:00 2020-01-04T00:00 1 33 21
|
||||
4 2017-10-01 Beijing 10 1 \N \N 2020-01-05T00:00 1 34 20
|
||||
1 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-01T00:00 2020-01-01T00:00 2017-10-01T11:11:11.170 2017-10-01T11:11:11.110111 2020-01-01T00:00 1 30 20
|
||||
1 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2017-10-01T11:11:11.160 2017-10-01T11:11:11.100111 2020-01-02T00:00 1 31 19
|
||||
2 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2017-10-01T11:11:11.150 2017-10-01T11:11:11.130111 2020-01-02T00:00 1 31 21
|
||||
2 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2017-10-01T11:11:11.140 2017-10-01T11:11:11.120111 2020-01-03T00:00 1 32 20
|
||||
3 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 \N \N \N \N 2020-01-05T00:00 1 34 20
|
||||
3 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2017-10-01T11:11:11.100 2017-10-01T11:11:11.140111 2020-01-03T00:00 1 32 22
|
||||
3 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-04T00:00 2020-01-04T00:00 2017-10-01T11:11:11.110 2017-10-01T11:11:11.150111 2020-01-04T00:00 1 33 21
|
||||
4 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 \N \N \N \N 2020-01-05T00:00 1 34 20
|
||||
|
||||
-- !select_default2 --
|
||||
1 2017-10-01 Beijing 10 1 2020-01-01T00:00 2020-01-01T00:00 2020-01-01T00:00 1 30 20
|
||||
1 2017-10-01 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2020-01-02T00:00 1 31 19
|
||||
2 2017-10-01 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2020-01-02T00:00 1 31 21
|
||||
2 2017-10-01 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2020-01-03T00:00 1 32 20
|
||||
3 2017-10-01 Beijing 10 1 \N \N 2020-01-05T00:00 1 34 20
|
||||
3 2017-10-01 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2020-01-03T00:00 1 32 22
|
||||
3 2017-10-01 Beijing 10 1 2020-01-04T00:00 2020-01-04T00:00 2020-01-04T00:00 1 33 21
|
||||
4 2017-10-01 Beijing 10 1 \N \N 2020-01-05T00:00 1 34 20
|
||||
1 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-01T00:00 2020-01-01T00:00 2017-10-01T11:11:11.170 2017-10-01T11:11:11.110111 2020-01-01T00:00 1 30 20
|
||||
1 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2017-10-01T11:11:11.160 2017-10-01T11:11:11.100111 2020-01-02T00:00 1 31 19
|
||||
2 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2017-10-01T11:11:11.150 2017-10-01T11:11:11.130111 2020-01-02T00:00 1 31 21
|
||||
2 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2017-10-01T11:11:11.140 2017-10-01T11:11:11.120111 2020-01-03T00:00 1 32 20
|
||||
3 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 \N \N \N \N 2020-01-05T00:00 1 34 20
|
||||
3 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2017-10-01T11:11:11.100 2017-10-01T11:11:11.140111 2020-01-03T00:00 1 32 22
|
||||
3 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-04T00:00 2020-01-04T00:00 2017-10-01T11:11:11.110 2017-10-01T11:11:11.150111 2020-01-04T00:00 1 33 21
|
||||
4 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 \N \N \N \N 2020-01-05T00:00 1 34 20
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
-- This file is automatically generated. You should know what you did if you want to edit this
|
||||
-- !select_default --
|
||||
1 2017-10-01 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2020-01-02T00:00 1 31 19
|
||||
2 2017-10-01 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2020-01-03T00:00 1 32 20
|
||||
3 2017-10-01 Beijing 10 1 \N \N 2020-01-05T00:00 1 34 20
|
||||
4 2017-10-01 Beijing 10 1 \N \N 2020-01-05T00:00 1 34 20
|
||||
1 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2017-10-01T11:11:11.160 2017-10-01T11:11:11.100111 2020-01-02T00:00 1 31 19
|
||||
2 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2017-10-01T11:11:11.140 2017-10-01T11:11:11.120111 2020-01-03T00:00 1 32 20
|
||||
3 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 \N \N \N \N 2020-01-05T00:00 1 34 20
|
||||
4 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 \N \N \N \N 2020-01-05T00:00 1 34 20
|
||||
|
||||
-- !select_default2 --
|
||||
1 2017-10-01 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2020-01-02T00:00 1 31 19
|
||||
2 2017-10-01 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2020-01-03T00:00 1 32 20
|
||||
3 2017-10-01 Beijing 10 1 \N \N 2020-01-05T00:00 1 34 20
|
||||
4 2017-10-01 Beijing 10 1 \N \N 2020-01-05T00:00 1 34 20
|
||||
1 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-02T00:00 2020-01-02T00:00 2017-10-01T11:11:11.160 2017-10-01T11:11:11.100111 2020-01-02T00:00 1 31 19
|
||||
2 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 2020-01-03T00:00 2020-01-03T00:00 2017-10-01T11:11:11.140 2017-10-01T11:11:11.120111 2020-01-03T00:00 1 32 20
|
||||
3 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 \N \N \N \N 2020-01-05T00:00 1 34 20
|
||||
4 2017-10-01 2017-10-01 2017-10-01T11:11:11.110 2017-10-01T11:11:11.110111 Beijing 10 1 \N \N \N \N 2020-01-05T00:00 1 34 20
|
||||
|
||||
|
||||
@ -3,3 +3,19 @@
|
||||
\N
|
||||
2022-08-01
|
||||
|
||||
-- !select --
|
||||
\N
|
||||
2022-08-01
|
||||
|
||||
-- !select --
|
||||
\N
|
||||
2022-08-01T11:11:11
|
||||
|
||||
-- !select --
|
||||
\N
|
||||
2022-08-01T11:11:11.111
|
||||
|
||||
-- !select --
|
||||
\N
|
||||
2022-08-01T11:11:11.111111
|
||||
|
||||
|
||||
@ -2,6 +2,24 @@
|
||||
-- !insert_into --
|
||||
4
|
||||
|
||||
-- !insert_into --
|
||||
4
|
||||
|
||||
-- !insert_into --
|
||||
4
|
||||
|
||||
-- !insert_into --
|
||||
4
|
||||
|
||||
-- !stream_load --
|
||||
4
|
||||
|
||||
-- !stream_load --
|
||||
4
|
||||
|
||||
-- !stream_load --
|
||||
4
|
||||
|
||||
-- !stream_load --
|
||||
4
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
2017-07-03,78,5,OlpJfkVz,176
|
||||
2017-07-03,73,18,iVM0NyAH,49
|
||||
2017-07-03,5,13,wvim4aqW,95
|
||||
2017-07-03,20,12,ZksFGmLv,172
|
||||
2017-07-03,39,15,Mf0RinDC,48
|
||||
2017-07-03,55,9,VGq4T2kt,10
|
||||
2017-07-03,50,12,p2TolhzU,149
|
||||
2017-07-03,22,17,Q8kWnJyU,122
|
||||
2017-07-03,54,16,upn9ZRPC,151
|
||||
2017-07-03,22,10,Nzp8B0L2,94
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,77,18,rFphH1sk,165
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,51,8,R47GKb1c,157
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,82,3,uD7bYnZK,62
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,78,8,Bf8K9rFd,122
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,38,20,A8JHqEfY,194
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,18,12,Emu786j5,84
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,43,10,yklMRVYJ,132
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,82,3,RvBK0g4o,118
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,0,18,EMuWnD0y,9
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,99,18,IjO9Hiof,1323
|
||||
@ -1,11 +1,11 @@
|
||||
event_day,siteid,citycode,username,pv
|
||||
2017-07-03,77,18,rFphH1sk,165
|
||||
2017-07-03,51,8,R47GKb1c,157
|
||||
2017-07-03,82,3,uD7bYnZK,62
|
||||
2017-07-03,78,8,Bf8K9rFd,122
|
||||
2017-07-03,38,20,A8JHqEfY,194
|
||||
2017-07-03,18,12,Emu786j5,84
|
||||
2017-07-03,43,10,yklMRVYJ,132
|
||||
2017-07-03,82,3,RvBK0g4o,118
|
||||
2017-07-03,0,18,EMuWnD0y,9
|
||||
2017-07-03,99,18,IjO9Hiof,132
|
||||
event_day,event_day1,event_day2,event_day3,event_day4,siteid,citycode,username,pv
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,77,18,rFphH1sk,165
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,51,8,R47GKb1c,157
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,82,3,uD7bYnZK,62
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,78,8,Bf8K9rFd,122
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,38,20,A8JHqEfY,194
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,18,12,Emu786j5,84
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,43,10,yklMRVYJ,132
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,82,3,RvBK0g4o,118
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,0,18,EMuWnD0y,9
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,99,18,IjO9Hiof,1323
|
||||
@ -1,12 +1,12 @@
|
||||
event_day,siteid,citycode,username,pv
|
||||
date,int,samllint,varchar,int
|
||||
2017-07-03,77,18,rFphH1sk,165
|
||||
2017-07-03,51,8,R47GKb1c,157
|
||||
2017-07-03,82,3,uD7bYnZK,62
|
||||
2017-07-03,78,8,Bf8K9rFd,122
|
||||
2017-07-03,38,20,A8JHqEfY,194
|
||||
2017-07-03,18,12,Emu786j5,84
|
||||
2017-07-03,43,10,yklMRVYJ,132
|
||||
2017-07-03,82,3,RvBK0g4o,118
|
||||
2017-07-03,0,18,EMuWnD0y,9
|
||||
2017-07-03,99,18,IjO9Hiof,1323
|
||||
event_day,event_day1,event_day2,event_day3,event_day4,siteid,citycode,username,pv
|
||||
date,datev2,datetimev2,datetimev2(3),datetimev2(6),int,samllint,varchar,int
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,77,18,rFphH1sk,165
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,51,8,R47GKb1c,157
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,82,3,uD7bYnZK,62
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,78,8,Bf8K9rFd,122
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,38,20,A8JHqEfY,194
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,18,12,Emu786j5,84
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,43,10,yklMRVYJ,132
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,82,3,RvBK0g4o,118
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,0,18,EMuWnD0y,9
|
||||
2017-07-03,2017-07-03,2017-07-03,2017-07-03,2017-07-03 11:11:11:111111,99,18,IjO9Hiof,1323
|
||||
@ -21,7 +21,7 @@ char_value_replace CHAR(10) Yes false \N REPLACE
|
||||
char_value_replace_if_not_null CHAR(10) Yes false \N REPLACE_IF_NOT_NULL
|
||||
|
||||
-- !date_agg_table --
|
||||
0 2000-12-31 2000-01-01 \N 2000-12-31
|
||||
0 2000-12-31 2000-01-01 \N 2000-12-31 2000-12-31 2000-01-01 \N 2000-12-31 2000-12-31T11:11:11 2000-01-01T11:11:11 \N 2000-12-31T11:11:11 2000-12-31T11:11:11.111 2000-01-01T11:11:11.111 \N 2000-12-31T11:11:11.111 2000-12-31T11:11:11.111111 2000-01-01T11:11:11.111111 \N 2000-12-31T11:11:11.111111
|
||||
|
||||
-- !desc_date_table --
|
||||
k INT Yes true \N
|
||||
@ -29,4 +29,20 @@ date_value_max DATE Yes false \N MAX
|
||||
date_value_min DATE Yes false \N MIN
|
||||
date_value_replace DATE Yes false \N REPLACE
|
||||
date_value_replace_if_not_null DATE Yes false \N REPLACE_IF_NOT_NULL
|
||||
datev2_value_max DATEV2 Yes false \N MAX
|
||||
datev2_value_min DATEV2 Yes false \N MIN
|
||||
datev2_value_replace DATEV2 Yes false \N REPLACE
|
||||
datev2_value_replace_if_not_null DATEV2 Yes false \N REPLACE_IF_NOT_NULL
|
||||
datetimev2_value_max DATETIMEV2(0) Yes false \N MAX
|
||||
datetimev2_value_min DATETIMEV2(0) Yes false \N MIN
|
||||
datetimev2_value_replace DATETIMEV2(0) Yes false \N REPLACE
|
||||
datetimev2_value_replace_if_not_null DATETIMEV2(0) Yes false \N REPLACE_IF_NOT_NULL
|
||||
datetimev2_value_max_1 DATETIMEV2(3) Yes false \N MAX
|
||||
datetimev2_value_min_1 DATETIMEV2(3) Yes false \N MIN
|
||||
datetimev2_value_replace_1 DATETIMEV2(3) Yes false \N REPLACE
|
||||
datetimev2_value_replace_if_not_null_1 DATETIMEV2(3) Yes false \N REPLACE_IF_NOT_NULL
|
||||
datetimev2_value_max_2 DATETIMEV2(6) Yes false \N MAX
|
||||
datetimev2_value_min_2 DATETIMEV2(6) Yes false \N MIN
|
||||
datetimev2_value_replace_2 DATETIMEV2(6) Yes false \N REPLACE
|
||||
datetimev2_value_replace_if_not_null_2 DATETIMEV2(6) Yes false \N REPLACE_IF_NOT_NULL
|
||||
|
||||
|
||||
@ -24,7 +24,33 @@
|
||||
2021-01-01
|
||||
|
||||
-- !select_in_pred_2 --
|
||||
1 2021-01-01 2021-01-02 2021-01-03
|
||||
1 2021-01-01 2021-01-02 2021-01-03 2021-01-01 2021-01-02 2021-01-03
|
||||
|
||||
-- !select_not_in_pred_1 --
|
||||
2021-02-01
|
||||
2021-03-01
|
||||
2021-04-01
|
||||
|
||||
-- !select_1_column --
|
||||
2021-01-01
|
||||
2021-02-01
|
||||
2021-03-01
|
||||
2021-04-01
|
||||
|
||||
-- !select_pred_1 --
|
||||
2021-03-01
|
||||
|
||||
-- !select_pred_2 --
|
||||
2021-04-01
|
||||
|
||||
-- !select_pred_3 --
|
||||
2021-04-02 2021-04-01
|
||||
|
||||
-- !select_in_pred_1 --
|
||||
2021-01-01
|
||||
|
||||
-- !select_in_pred_2 --
|
||||
1 2021-01-01 2021-01-02 2021-01-03 2021-01-01 2021-01-02 2021-01-03
|
||||
|
||||
-- !select_not_in_pred_1 --
|
||||
2021-02-01
|
||||
|
||||
@ -26,7 +26,51 @@
|
||||
2021-01-01
|
||||
|
||||
-- !select_in_pred_1 --
|
||||
1 2021-01-01 2021-01-02 2021-01-03
|
||||
1 2021-01-01 2021-01-02 2021-01-03 2021-01-01 2021-01-02 2021-01-03
|
||||
|
||||
-- !select_not_in_pred_1 --
|
||||
2021-02-01
|
||||
2021-03-01
|
||||
2021-04-01
|
||||
2021-05-01
|
||||
|
||||
-- !select_is_null_pred --
|
||||
2021-05-01
|
||||
|
||||
-- !select_is_not_null_pred --
|
||||
2021-01-01
|
||||
2021-02-01
|
||||
2021-03-01
|
||||
2021-04-01
|
||||
|
||||
-- !sql1 --
|
||||
2021-01-01
|
||||
2021-02-01
|
||||
2021-03-01
|
||||
2021-04-01
|
||||
2021-05-01
|
||||
|
||||
-- !select_1_column --
|
||||
2021-01-01
|
||||
2021-02-01
|
||||
2021-03-01
|
||||
2021-04-01
|
||||
2021-05-01
|
||||
|
||||
-- !select_pred_1 --
|
||||
2021-03-01
|
||||
|
||||
-- !select_pred_2 --
|
||||
2021-04-01
|
||||
|
||||
-- !select_pred_3 --
|
||||
2021-04-02 2021-04-01
|
||||
|
||||
-- !select_in_pred_1 --
|
||||
2021-01-01
|
||||
|
||||
-- !select_in_pred_1 --
|
||||
1 2021-01-01 2021-01-02 2021-01-03 2021-01-01 2021-01-02 2021-01-03
|
||||
|
||||
-- !select_not_in_pred_1 --
|
||||
2021-02-01
|
||||
|
||||
@ -17,5 +17,69 @@
|
||||
2021-06-02T22:10:04
|
||||
|
||||
-- !read_multiple_column --
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
|
||||
-- !read_single_column_1 --
|
||||
2021-01-01T23:10:01
|
||||
2021-01-01T23:10:01
|
||||
2021-01-01T23:10:01
|
||||
2021-01-01T23:10:01
|
||||
2021-01-01T23:10:01
|
||||
|
||||
-- !datetime_as_pred --
|
||||
1 2021-01-01T23:10:01 2021-01-02T23:10:04 2021-01-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
2 2021-02-01T23:10:01 2021-02-02T23:10:04 2021-03-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
3 2021-03-01T23:10:01 2021-03-02T23:10:04 2021-04-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
4 2021-04-01T23:10:01 2021-04-02T23:10:04 2021-05-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
|
||||
-- !read_multiple_column --
|
||||
|
||||
-- !read_multiple_column --
|
||||
1 2021-01-01T23:10:01 2021-01-02T23:10:04 2021-01-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
2 2021-02-01T23:10:01 2021-02-02T23:10:04 2021-03-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
3 2021-03-01T23:10:01 2021-03-02T23:10:04 2021-04-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
4 2021-04-01T23:10:01 2021-04-02T23:10:04 2021-05-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
|
||||
-- !read_single_column_1 --
|
||||
2021-01-02T23:10:04.111
|
||||
2021-01-02T23:10:04.111
|
||||
2021-01-02T23:10:04.111
|
||||
2021-01-02T23:10:04.111
|
||||
2021-01-02T23:10:04.111
|
||||
|
||||
-- !datetime_as_pred --
|
||||
|
||||
-- !read_multiple_column --
|
||||
1 2021-01-01T23:10:01 2021-01-02T23:10:04 2021-01-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
2 2021-02-01T23:10:01 2021-02-02T23:10:04 2021-03-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
3 2021-03-01T23:10:01 2021-03-02T23:10:04 2021-04-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
4 2021-04-01T23:10:01 2021-04-02T23:10:04 2021-05-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
|
||||
-- !read_multiple_column --
|
||||
1 2021-01-01T23:10:01 2021-01-02T23:10:04 2021-01-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
2 2021-02-01T23:10:01 2021-02-02T23:10:04 2021-03-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
3 2021-03-01T23:10:01 2021-03-02T23:10:04 2021-04-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
4 2021-04-01T23:10:01 2021-04-02T23:10:04 2021-05-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
|
||||
-- !read_single_column_1 --
|
||||
2021-01-02T22:10:04.111111
|
||||
2021-01-02T22:10:04.111111
|
||||
2021-01-02T22:10:04.111111
|
||||
2021-01-02T22:10:04.111111
|
||||
2021-01-02T22:10:04.111111
|
||||
|
||||
-- !datetime_as_pred --
|
||||
|
||||
-- !read_multiple_column --
|
||||
1 2021-01-01T23:10:01 2021-01-02T23:10:04 2021-01-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
2 2021-02-01T23:10:01 2021-02-02T23:10:04 2021-03-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
3 2021-03-01T23:10:01 2021-03-02T23:10:04 2021-04-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
4 2021-04-01T23:10:01 2021-04-02T23:10:04 2021-05-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
|
||||
-- !read_multiple_column --
|
||||
|
||||
|
||||
@ -26,32 +26,153 @@
|
||||
2021-05-02T22:10:04
|
||||
|
||||
-- !read_multiple_column_1 --
|
||||
\N 2021-06-01T23:10:01 \N 2021-06-02T22:10:04
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04
|
||||
\N 2021-06-01T23:10:01 \N 2021-06-02T22:10:04 2021-06-01T23:10:01 \N 2021-06-02T22:10:04.111111
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04 2021-05-01T23:10:01 2021-05-02T23:10:04.111 2021-06-02T22:10:04.111111
|
||||
|
||||
-- !read_multiple_column_2 --
|
||||
1 2021-01-01T23:10:01 2021-01-02T23:10:04 2021-01-02T22:10:04
|
||||
2 2021-02-01T23:10:01 2021-02-02T23:10:04 2021-03-02T22:10:04
|
||||
3 2021-03-01T23:10:01 2021-03-02T23:10:04 2021-04-02T22:10:04
|
||||
4 2021-04-01T23:10:01 2021-04-02T23:10:04 2021-05-02T22:10:04
|
||||
1 2021-01-01T23:10:01 2021-01-02T23:10:04 2021-01-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
2 2021-02-01T23:10:01 2021-02-02T23:10:04 2021-03-02T22:10:04 2021-02-01T23:10:01 2021-02-02T23:10:04.111 2021-03-02T22:10:04.111111
|
||||
3 2021-03-01T23:10:01 2021-03-02T23:10:04 2021-04-02T22:10:04 2021-03-01T23:10:01 2021-03-02T23:10:04.111 2021-04-02T22:10:04.111111
|
||||
4 2021-04-01T23:10:01 2021-04-02T23:10:04 2021-05-02T22:10:04 2021-04-01T23:10:01 2021-04-02T23:10:04.111 2021-05-02T22:10:04.111111
|
||||
|
||||
-- !key_is_null --
|
||||
\N 2021-06-01T23:10:01 \N 2021-06-02T22:10:04
|
||||
\N 2021-06-01T23:10:01 \N 2021-06-02T22:10:04 2021-06-01T23:10:01 \N 2021-06-02T22:10:04.111111
|
||||
|
||||
-- !key_is_not_null --
|
||||
1 2021-01-01T23:10:01 2021-01-02T23:10:04 2021-01-02T22:10:04
|
||||
2 2021-02-01T23:10:01 2021-02-02T23:10:04 2021-03-02T22:10:04
|
||||
3 2021-03-01T23:10:01 2021-03-02T23:10:04 2021-04-02T22:10:04
|
||||
4 2021-04-01T23:10:01 2021-04-02T23:10:04 2021-05-02T22:10:04
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04
|
||||
1 2021-01-01T23:10:01 2021-01-02T23:10:04 2021-01-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
2 2021-02-01T23:10:01 2021-02-02T23:10:04 2021-03-02T22:10:04 2021-02-01T23:10:01 2021-02-02T23:10:04.111 2021-03-02T22:10:04.111111
|
||||
3 2021-03-01T23:10:01 2021-03-02T23:10:04 2021-04-02T22:10:04 2021-03-01T23:10:01 2021-03-02T23:10:04.111 2021-04-02T22:10:04.111111
|
||||
4 2021-04-01T23:10:01 2021-04-02T23:10:04 2021-05-02T22:10:04 2021-04-01T23:10:01 2021-04-02T23:10:04.111 2021-05-02T22:10:04.111111
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04 2021-05-01T23:10:01 2021-05-02T23:10:04.111 2021-06-02T22:10:04.111111
|
||||
|
||||
-- !non_key_is_null --
|
||||
\N 2021-06-01T23:10:01 \N 2021-06-02T22:10:04
|
||||
\N 2021-06-01T23:10:01 \N 2021-06-02T22:10:04 2021-06-01T23:10:01 \N 2021-06-02T22:10:04.111111
|
||||
|
||||
-- !non_key_is_not_null --
|
||||
1 2021-01-01T23:10:01 2021-01-02T23:10:04 2021-01-02T22:10:04
|
||||
2 2021-02-01T23:10:01 2021-02-02T23:10:04 2021-03-02T22:10:04
|
||||
3 2021-03-01T23:10:01 2021-03-02T23:10:04 2021-04-02T22:10:04
|
||||
4 2021-04-01T23:10:01 2021-04-02T23:10:04 2021-05-02T22:10:04
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04
|
||||
1 2021-01-01T23:10:01 2021-01-02T23:10:04 2021-01-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
2 2021-02-01T23:10:01 2021-02-02T23:10:04 2021-03-02T22:10:04 2021-02-01T23:10:01 2021-02-02T23:10:04.111 2021-03-02T22:10:04.111111
|
||||
3 2021-03-01T23:10:01 2021-03-02T23:10:04 2021-04-02T22:10:04 2021-03-01T23:10:01 2021-03-02T23:10:04.111 2021-04-02T22:10:04.111111
|
||||
4 2021-04-01T23:10:01 2021-04-02T23:10:04 2021-05-02T22:10:04 2021-04-01T23:10:01 2021-04-02T23:10:04.111 2021-05-02T22:10:04.111111
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04 2021-05-01T23:10:01 2021-05-02T23:10:04.111 2021-06-02T22:10:04.111111
|
||||
|
||||
-- !non_key_is_null --
|
||||
\N 2021-06-01T23:10:01 \N 2021-06-02T22:10:04 2021-06-01T23:10:01 \N 2021-06-02T22:10:04.111111
|
||||
|
||||
-- !non_key_is_not_null --
|
||||
1 2021-01-01T23:10:01 2021-01-02T23:10:04 2021-01-02T22:10:04 2021-01-01T23:10:01 2021-01-02T23:10:04.111 2021-01-02T22:10:04.111111
|
||||
2 2021-02-01T23:10:01 2021-02-02T23:10:04 2021-03-02T22:10:04 2021-02-01T23:10:01 2021-02-02T23:10:04.111 2021-03-02T22:10:04.111111
|
||||
3 2021-03-01T23:10:01 2021-03-02T23:10:04 2021-04-02T22:10:04 2021-03-01T23:10:01 2021-03-02T23:10:04.111 2021-04-02T22:10:04.111111
|
||||
4 2021-04-01T23:10:01 2021-04-02T23:10:04 2021-05-02T22:10:04 2021-04-01T23:10:01 2021-04-02T23:10:04.111 2021-05-02T22:10:04.111111
|
||||
5 2021-05-01T23:10:01 2021-05-02T23:10:04 2021-06-02T22:10:04 2021-05-01T23:10:01 2021-05-02T23:10:04.111 2021-06-02T22:10:04.111111
|
||||
|
||||
-- !read_single_column_1 --
|
||||
2021-06-01T23:10:01
|
||||
2021-01-01T23:10:01
|
||||
2021-02-01T23:10:01
|
||||
2021-03-01T23:10:01
|
||||
2021-04-01T23:10:01
|
||||
2021-05-01T23:10:01
|
||||
|
||||
-- !datetime_as_pred_1 --
|
||||
2021-05-01T23:10:01
|
||||
|
||||
-- !datetime_as_pred_2 --
|
||||
2021-06-01T23:10:01
|
||||
2021-01-01T23:10:01
|
||||
2021-02-01T23:10:01
|
||||
2021-03-01T23:10:01
|
||||
2021-04-01T23:10:01
|
||||
|
||||
-- !datetime_as_pred_3 --
|
||||
|
||||
-- !datetime_as_pred_4 --
|
||||
2021-06-01T23:10:01
|
||||
2021-01-01T23:10:01
|
||||
2021-02-01T23:10:01
|
||||
2021-03-01T23:10:01
|
||||
2021-04-01T23:10:01
|
||||
2021-05-01T23:10:01
|
||||
|
||||
-- !datetime_as_pred_5 --
|
||||
2021-01-01T23:10:01
|
||||
2021-02-01T23:10:01
|
||||
2021-03-01T23:10:01
|
||||
2021-04-01T23:10:01
|
||||
2021-05-01T23:10:01
|
||||
|
||||
-- !datetime_as_pred_6 --
|
||||
2021-01-01T23:10:01
|
||||
2021-02-01T23:10:01
|
||||
2021-03-01T23:10:01
|
||||
2021-04-01T23:10:01
|
||||
2021-05-01T23:10:01
|
||||
|
||||
-- !read_single_column_1 --
|
||||
\N
|
||||
2021-01-02T23:10:04.111
|
||||
2021-02-02T23:10:04.111
|
||||
2021-03-02T23:10:04.111
|
||||
2021-04-02T23:10:04.111
|
||||
2021-05-02T23:10:04.111
|
||||
|
||||
-- !datetime_as_pred_1 --
|
||||
2021-05-02T23:10:04.111
|
||||
|
||||
-- !datetime_as_pred_2 --
|
||||
2021-01-02T23:10:04.111
|
||||
2021-02-02T23:10:04.111
|
||||
2021-03-02T23:10:04.111
|
||||
2021-04-02T23:10:04.111
|
||||
|
||||
-- !datetime_as_pred_3 --
|
||||
|
||||
-- !datetime_as_pred_4 --
|
||||
\N
|
||||
2021-01-02T23:10:04.111
|
||||
2021-02-02T23:10:04.111
|
||||
2021-03-02T23:10:04.111
|
||||
2021-04-02T23:10:04.111
|
||||
2021-05-02T23:10:04.111
|
||||
|
||||
-- !datetime_as_pred_5 --
|
||||
2021-01-02T23:10:04.111
|
||||
2021-02-02T23:10:04.111
|
||||
2021-03-02T23:10:04.111
|
||||
2021-04-02T23:10:04.111
|
||||
2021-05-02T23:10:04.111
|
||||
|
||||
-- !datetime_as_pred_6 --
|
||||
2021-01-02T23:10:04.111
|
||||
2021-02-02T23:10:04.111
|
||||
2021-03-02T23:10:04.111
|
||||
2021-04-02T23:10:04.111
|
||||
|
||||
-- !read_single_column_1 --
|
||||
2021-06-02T22:10:04.111111
|
||||
2021-01-02T22:10:04.111111
|
||||
2021-03-02T22:10:04.111111
|
||||
2021-04-02T22:10:04.111111
|
||||
2021-05-02T22:10:04.111111
|
||||
2021-06-02T22:10:04.111111
|
||||
|
||||
-- !datetime_as_pred_1 --
|
||||
2021-05-02T22:10:04.111111
|
||||
|
||||
-- !datetime_as_pred_2 --
|
||||
2021-06-02T22:10:04.111111
|
||||
2021-01-02T22:10:04.111111
|
||||
2021-03-02T22:10:04.111111
|
||||
2021-04-02T22:10:04.111111
|
||||
2021-06-02T22:10:04.111111
|
||||
|
||||
-- !datetime_as_pred_3 --
|
||||
2021-01-02T22:10:04.111111
|
||||
2021-03-02T22:10:04.111111
|
||||
2021-04-02T22:10:04.111111
|
||||
|
||||
-- !datetime_as_pred_4 --
|
||||
2021-01-02T22:10:04.111111
|
||||
2021-03-02T22:10:04.111111
|
||||
2021-04-02T22:10:04.111111
|
||||
2021-05-02T22:10:04.111111
|
||||
|
||||
|
||||
@ -1,14 +1,18 @@
|
||||
-- This file is automatically generated. You should know what you did if you want to edit this
|
||||
-- !select_dup_table --
|
||||
0 \N \N \N
|
||||
0 1 test char 2000-01-01
|
||||
0 2 test int 2000-02-02
|
||||
0 \N \N \N \N \N \N \N
|
||||
0 1 test char 2000-01-01 2000-01-01 2000-01-01T11:00:11 2000-01-01T11:00:11.111 2000-01-01T11:00:11.111111
|
||||
0 2 test int 2000-02-02 2000-02-02 2000-02-02T11:00:11 2000-02-02T11:00:11.111 2000-02-02T11:00:11.111111
|
||||
|
||||
-- !desc_dup_table --
|
||||
k INT Yes true \N
|
||||
int_value INT Yes false \N NONE
|
||||
char_value CHAR(10) Yes false \N NONE
|
||||
date_value DATE Yes false \N NONE
|
||||
date_value2 DATEV2 Yes false \N NONE
|
||||
date_value3 DATETIMEV2(0) Yes false \N NONE
|
||||
date_value4 DATETIMEV2(3) Yes false \N NONE
|
||||
date_value5 DATETIMEV2(6) Yes false \N NONE
|
||||
|
||||
-- !select_dup_table --
|
||||
0 1 2 3
|
||||
|
||||
@ -1,8 +1,15 @@
|
||||
-- This file is automatically generated. You should know what you did if you want to edit this
|
||||
-- !sql1 --
|
||||
2 test2 2000-02-02
|
||||
2 test2 2000-02-02 2000-02-02
|
||||
|
||||
-- !sql2 --
|
||||
1 test1 2000-01-01
|
||||
3 test3 2000-03-02
|
||||
1 test1 2000-01-01 2000-01-01
|
||||
3 test3 2000-03-02 2000-03-02
|
||||
|
||||
-- !sql3 --
|
||||
2 test2 2000-02-02 2000-02-02
|
||||
|
||||
-- !sql4 --
|
||||
1 test1 2000-01-01 2000-01-01
|
||||
3 test3 2000-03-02 2000-03-02
|
||||
|
||||
|
||||
@ -14,3 +14,29 @@
|
||||
-- !sql --
|
||||
8
|
||||
|
||||
-- !sql --
|
||||
abcdef 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111
|
||||
|
||||
-- !sql --
|
||||
abcdef 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111
|
||||
|
||||
-- !sql --
|
||||
abcdef 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111
|
||||
abcdef 2022-08-16 2022-08-16T11:11:11 2022-08-16T11:11:11.111 2022-08-16 2022-08-16T11:11:11 2022-08-16T11:11:11.111
|
||||
|
||||
-- !sql --
|
||||
abcdef 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111
|
||||
|
||||
-- !sql --
|
||||
abcdef 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111
|
||||
|
||||
-- !sql --
|
||||
abcdef 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111
|
||||
|
||||
-- !sql --
|
||||
abcdef 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111
|
||||
abcdef 2022-08-16 2022-08-16T11:11:11 2022-08-16T11:11:11.111 2022-08-16 2022-08-16T11:11:11 2022-08-16T11:11:11.111
|
||||
|
||||
-- !sql --
|
||||
abcdef 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111 2022-08-12 2022-08-16T12:11:11 2022-08-16T12:11:11.111
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -20,6 +20,18 @@ TESTING AGAIN
|
||||
-- !aggregate --
|
||||
12 0.245 AGAIN 1922-04-02 1989-01-08T04:05:06
|
||||
|
||||
-- !aggregate --
|
||||
15 15 14 14 14 14 14 15
|
||||
|
||||
-- !aggregate --
|
||||
9 9 10 8 7 7 7 2
|
||||
|
||||
-- !aggregate --
|
||||
8996 99.8777 testing 1999-01-08 2010-01-02T05:09:06 2010-01-02T05:09:06.111 2010-01-02T05:09:06.111111
|
||||
|
||||
-- !aggregate --
|
||||
12 0.245 AGAIN 1922-04-02 1989-01-08T04:05:06 1989-01-08T04:05:06.111 1989-01-08T04:05:06.111111
|
||||
|
||||
-- !aggregate --
|
||||
14 99.8777 3309.4
|
||||
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
12|12.25|String1|1999-01-08|1999-01-08 02:05:06|TRUE|123.22|12345678901234567890.0123456789
|
||||
25|55.52|test|1952-01-05|1989-01-08 04:05:06|FALSE|321.21|-12345678901234567890.0123456789
|
||||
964|0.245|Again|1936-02-08|2005-01-09 04:05:06|FALSE|333.82|98765432109876543210.9876543210
|
||||
100|12.25|testing|1949-07-08|2002-01-07 01:05:06|TRUE|-393.22|-98765432109876543210.9876543210
|
||||
100|99.8777|AGAIN|1987-04-09|2010-01-02 04:03:06|TRUE|000.00|00000000000000000000.0000000000
|
||||
5252|12.25|sample|1987-04-09|2010-01-02 04:03:06|TRUE|123.00|00000000000000000001.0000000000
|
||||
100|9.8777|STRING1|1923-04-08|2010-01-02 05:09:06|TRUE|010.01|00000000000000000002.0000000000
|
||||
8996|98.8777|again|1987-04-09|2010-01-02 04:03:06|FALSE|-000.01|99999999999999999999.9999999999
|
||||
100|12.8788|string1|1922-04-02|2010-01-02 02:05:06|TRUE|999.99|-99999999999999999999.9999999999
|
||||
5748|67.87|sample|1987-04-06|2010-01-02 04:03:06|TRUE|-999.99|00000000000000000000.0000000001
|
||||
5748|67.87|Sample|1987-04-06|2010-01-02 04:03:06|TRUE|181.18|-00000000000000000000.0000000001
|
||||
5748|67.87|sample|1987-04-06|2010-01-02 04:03:06|TRUE|181.18|12345678901234567890.0123456789
|
||||
5748|67.87|sample|1987-04-06|2010-01-02 04:03:06|TRUE|181.18|12345678901234567890.0123456789
|
||||
5000|67.87|testing|\N|2010-01-02 04:03:06|\N|\N|\N
|
||||
6000|\N|\N|1987-04-06|\N|TRUE|\N|\N
|
||||
\N|98.52|\N|\N|\N|TRUE|181.18|\N
|
||||
12|12.25|String1|1999-01-08|1999-01-08 02:05:06|1999-01-08|1999-01-08 02:05:06.111111|1999-01-08 02:05:06.111111|1999-01-08 02:05:06.111111|TRUE|123.22|12345678901234567890.0123456789
|
||||
25|55.52|test|1952-01-05|1989-01-08 04:05:06|1952-01-05|1989-01-08 04:05:06.111111|1989-01-08 04:05:06.111111|1989-01-08 04:05:06.111111|FALSE|321.21|-12345678901234567890.0123456789
|
||||
964|0.245|Again|1936-02-08|2005-01-09 04:05:06|1936-02-08|2005-01-09 04:05:06.111111|2005-01-09 04:05:06.111111|2005-01-09 04:05:06.111111|FALSE|333.82|98765432109876543210.9876543210
|
||||
100|12.25|testing|1949-07-08|2002-01-07 01:05:06|1949-07-08|2002-01-07 01:05:06.111111|2002-01-07 01:05:06.111111|2002-01-07 01:05:06.111111|TRUE|-393.22|-98765432109876543210.9876543210
|
||||
100|99.8777|AGAIN|1987-04-09|2010-01-02 04:03:06|1987-04-09|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|TRUE|000.00|00000000000000000000.0000000000
|
||||
5252|12.25|sample|1987-04-09|2010-01-02 04:03:06|1987-04-09|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|TRUE|123.00|00000000000000000001.0000000000
|
||||
100|9.8777|STRING1|1923-04-08|2010-01-02 05:09:06|1923-04-08|2010-01-02 05:09:06.111111|2010-01-02 05:09:06.111111|2010-01-02 05:09:06.111111|TRUE|010.01|00000000000000000002.0000000000
|
||||
8996|98.8777|again|1987-04-09|2010-01-02 04:03:06|1987-04-09|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|FALSE|-000.01|99999999999999999999.9999999999
|
||||
100|12.8788|string1|1922-04-02|2010-01-02 02:05:06|1922-04-02|2010-01-02 02:05:06.111111|2010-01-02 02:05:06.111111|2010-01-02 02:05:06.111111|TRUE|999.99|-99999999999999999999.9999999999
|
||||
5748|67.87|sample|1987-04-06|2010-01-02 04:03:06|1987-04-06|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|TRUE|-999.99|00000000000000000000.0000000001
|
||||
5748|67.87|Sample|1987-04-06|2010-01-02 04:03:06|1987-04-06|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|TRUE|181.18|-00000000000000000000.0000000001
|
||||
5748|67.87|sample|1987-04-06|2010-01-02 04:03:06|1987-04-06|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|TRUE|181.18|12345678901234567890.0123456789
|
||||
5748|67.87|sample|1987-04-06|2010-01-02 04:03:06|1987-04-06|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|TRUE|181.18|12345678901234567890.0123456789
|
||||
5000|67.87|testing|\N|2010-01-02 04:03:06|\N|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|\N|\N|\N
|
||||
6000|\N|\N|1987-04-06|\N|1987-04-06|\N|\N|\N|TRUE|\N|\N
|
||||
\N|98.52|\N|\N|\N|\N|\N|\N|\N|TRUE|181.18|\N
|
||||
|
||||
|
@ -5,3 +5,9 @@
|
||||
-- !window_funnel --
|
||||
2
|
||||
|
||||
-- !window_funnel --
|
||||
1
|
||||
|
||||
-- !window_funnel --
|
||||
2
|
||||
|
||||
|
||||
@ -12,3 +12,60 @@
|
||||
2022-05-30 0
|
||||
2022-06-01 0
|
||||
2022-06-02 0
|
||||
|
||||
-- !partition_cache --
|
||||
2022-05-28 0
|
||||
2022-05-29 0
|
||||
2022-05-30 0
|
||||
2022-06-01 0
|
||||
2022-06-02 0
|
||||
|
||||
-- !partition_cache --
|
||||
2022-05-28 0
|
||||
2022-05-29 0
|
||||
2022-05-30 0
|
||||
2022-06-01 0
|
||||
2022-06-02 0
|
||||
|
||||
-- !partition_cache --
|
||||
2022-05-28T11:11:11.111 0
|
||||
2022-05-29T11:11:11.111 0
|
||||
2022-05-30T11:11:11.111 0
|
||||
2022-06-01T11:11:11.111 0
|
||||
2022-06-02T11:11:11.111 0
|
||||
|
||||
-- !partition_cache --
|
||||
2022-05-28T11:11:11.111 0
|
||||
2022-05-29T11:11:11.111 0
|
||||
2022-05-30T11:11:11.111 0
|
||||
2022-06-01T11:11:11.111 0
|
||||
2022-06-02T11:11:11.111 0
|
||||
|
||||
-- !partition_cache --
|
||||
2022-05-28T11:11:11.111 0
|
||||
2022-05-29T11:11:11.111 0
|
||||
2022-05-30T11:11:11.111 0
|
||||
2022-06-01T11:11:11.111 0
|
||||
2022-06-02T11:11:11.111 0
|
||||
|
||||
-- !partition_cache --
|
||||
2022-05-28T11:11:11.111 0
|
||||
2022-05-29T11:11:11.111 0
|
||||
2022-05-30T11:11:11.111 0
|
||||
2022-06-01T11:11:11.111 0
|
||||
2022-06-02T11:11:11.111 0
|
||||
|
||||
-- !partition_cache --
|
||||
2022-05-28T11:11:11.111111 0
|
||||
2022-05-29T11:11:11.111111 0
|
||||
2022-05-30T11:11:11.111111 0
|
||||
2022-06-01T11:11:11.111111 0
|
||||
2022-06-02T11:11:11.111111 0
|
||||
|
||||
-- !partition_cache --
|
||||
2022-05-28T11:11:11.111111 0
|
||||
2022-05-29T11:11:11.111111 0
|
||||
2022-05-30T11:11:11.111111 0
|
||||
2022-06-01T11:11:11.111111 0
|
||||
2022-06-02T11:11:11.111111 0
|
||||
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
12|12.25|String1|1999-01-08|1999-01-08 02:05:06|TRUE|123.22|12345678901234567890.0123456789
|
||||
25|55.52|test|1952-01-05|1989-01-08 04:05:06|FALSE|321.21|-12345678901234567890.0123456789
|
||||
964|0.245|Again|1936-02-08|2005-01-09 04:05:06|FALSE|333.82|98765432109876543210.9876543210
|
||||
100|12.25|testing|1949-07-08|2002-01-07 01:05:06|TRUE|-393.22|-98765432109876543210.9876543210
|
||||
100|99.8777|AGAIN|1987-04-09|2010-01-02 04:03:06|TRUE|000.00|00000000000000000000.0000000000
|
||||
5252|12.25|sample|1987-04-09|2010-01-02 04:03:06|TRUE|123.00|00000000000000000001.0000000000
|
||||
100|9.8777|STRING1|1923-04-08|2010-01-02 05:09:06|TRUE|010.01|00000000000000000002.0000000000
|
||||
8996|98.8777|again|1987-04-09|2010-01-02 04:03:06|FALSE|-000.01|99999999999999999999.9999999999
|
||||
100|12.8788|string1|1922-04-02|2010-01-02 02:05:06|TRUE|999.99|-99999999999999999999.9999999999
|
||||
5748|67.87|sample|1987-04-06|2010-01-02 04:03:06|TRUE|-999.99|00000000000000000000.0000000001
|
||||
5748|67.87|Sample|1987-04-06|2010-01-02 04:03:06|TRUE|181.18|-00000000000000000000.0000000001
|
||||
5748|67.87|sample|1987-04-06|2010-01-02 04:03:06|TRUE|181.18|12345678901234567890.0123456789
|
||||
5748|67.87|sample|1987-04-06|2010-01-02 04:03:06|TRUE|181.18|12345678901234567890.0123456789
|
||||
5000|67.87|testing|\N|2010-01-02 04:03:06|\N|\N|\N
|
||||
6000|\N|\N|1987-04-06|\N|TRUE|\N|\N
|
||||
\N|98.52|\N|\N|\N|TRUE|181.18|\N
|
||||
12|12.25|String1|1999-01-08|1999-01-08 02:05:06|1999-01-08|1999-01-08 02:05:06.111111|1999-01-08 02:05:06.111111|1999-01-08 02:05:06.111111|TRUE|123.22|12345678901234567890.0123456789
|
||||
25|55.52|test|1952-01-05|1989-01-08 04:05:06|1952-01-05|1989-01-08 04:05:06.111111|1989-01-08 04:05:06.111111|1989-01-08 04:05:06.111111|FALSE|321.21|-12345678901234567890.0123456789
|
||||
964|0.245|Again|1936-02-08|2005-01-09 04:05:06|1936-02-08|2005-01-09 04:05:06.111111|2005-01-09 04:05:06.111111|2005-01-09 04:05:06.111111|FALSE|333.82|98765432109876543210.9876543210
|
||||
100|12.25|testing|1949-07-08|2002-01-07 01:05:06|1949-07-08|2002-01-07 01:05:06.111111|2002-01-07 01:05:06.111111|2002-01-07 01:05:06.111111|TRUE|-393.22|-98765432109876543210.9876543210
|
||||
100|99.8777|AGAIN|1987-04-09|2010-01-02 04:03:06|1987-04-09|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|TRUE|000.00|00000000000000000000.0000000000
|
||||
5252|12.25|sample|1987-04-09|2010-01-02 04:03:06|1987-04-09|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|TRUE|123.00|00000000000000000001.0000000000
|
||||
100|9.8777|STRING1|1923-04-08|2010-01-02 05:09:06|1923-04-08|2010-01-02 05:09:06.111111|2010-01-02 05:09:06.111111|2010-01-02 05:09:06.111111|TRUE|010.01|00000000000000000002.0000000000
|
||||
8996|98.8777|again|1987-04-09|2010-01-02 04:03:06|1987-04-09|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|FALSE|-000.01|99999999999999999999.9999999999
|
||||
100|12.8788|string1|1922-04-02|2010-01-02 02:05:06|1922-04-02|2010-01-02 02:05:06.111111|2010-01-02 02:05:06.111111|2010-01-02 02:05:06.111111|TRUE|999.99|-99999999999999999999.9999999999
|
||||
5748|67.87|sample|1987-04-06|2010-01-02 04:03:06|1987-04-06|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|TRUE|-999.99|00000000000000000000.0000000001
|
||||
5748|67.87|Sample|1987-04-06|2010-01-02 04:03:06|1987-04-06|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|TRUE|181.18|-00000000000000000000.0000000001
|
||||
5748|67.87|sample|1987-04-06|2010-01-02 04:03:06|1987-04-06|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|TRUE|181.18|12345678901234567890.0123456789
|
||||
5748|67.87|sample|1987-04-06|2010-01-02 04:03:06|1987-04-06|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|TRUE|181.18|12345678901234567890.0123456789
|
||||
5000|67.87|testing|\N|2010-01-02 04:03:06|\N|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|2010-01-02 04:03:06.111111|\N|\N|\N
|
||||
6000|\N|\N|1987-04-06|\N|1987-04-06|\N|\N|\N|TRUE|\N|\N
|
||||
\N|98.52|\N|\N|\N|\N|\N|\N|\N|TRUE|181.18|\N
|
||||
|
||||
|
@ -7,6 +7,15 @@ true
|
||||
-- !select --
|
||||
2010-01-02T04:03:06
|
||||
|
||||
-- !select --
|
||||
2010-01-02T04:03:06
|
||||
|
||||
-- !select --
|
||||
2010-01-02T04:03:06.111
|
||||
|
||||
-- !select --
|
||||
2010-01-02T04:03:06.111111
|
||||
|
||||
-- !if_nullif1 --
|
||||
10 worlk
|
||||
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
6 32767 3021 123456 604587.000 true 2014-11-11 2015-03-13 12:36:38 yanhuiacng01 0.1 80699
|
||||
10 1991 5014 9223372036854775807 -258.369 false 2015-04-02 2013-04-02 15:16:52 wangyu14 -123456.54 0.235
|
||||
12 32767 -2147483647 9223372036854775807 243.325 false 1991-08-11 2013-04-02 15:16:52 liuyuantuo -564.898 3.1415927
|
||||
1 1989 1001 11011902 123.123 true 1989-03-21 1989-03-21 13:00:00 wangjing04 0.1 6.333
|
||||
2 1986 1001 11011903 1243.500 false 1901-12-31 1989-03-21 13:00:00 wangyu14 20.268 789.25
|
||||
4 1991 3021 -11011907 243243.325 false 3124-10-10 2015-03-13 10:30:00 yanhuicang01 2.06 -0.001
|
||||
5 1985 5014 -11011903 243.325 true 2015-01-01 2015-03-13 12:36:38 duyunkai@123 -0 -365
|
||||
15 1992 3021 11011920 0.000 true 9999-12-12 2015-04-02 00:00:00 3.141592653 20.456
|
||||
3 1989 1002 11011905 24453.325 false 2012-03-14 2000-01-01 00:00:00 yuanyuan06 78945 3654
|
||||
7 -32767 1002 7210457 3.141 false 1988-03-21 1901-01-01 00:00:00 jingyong 0 6058
|
||||
8 255 2147483647 11011920 -0.123 true 1989-03-21 9999-11-11 12:12:00 wangjing05 987456.123 12.14
|
||||
9 1991 -2147483647 11011902 -654.654 true 1991-08-11 1989-03-21 13:11:00 wangjing04 0 69.123
|
||||
11 1989 25699 -9223372036854775807 0.666 true 2015-04-02 1989-03-21 13:11:00 yuanyuan06 -987.001 4.336
|
||||
13 -32767 2147483647 -9223372036854775807 100.001 false 2015-04-02 2015-04-02 00:00:00 weike01 123.456 3.1415927
|
||||
14 255 103 11011902 0.000 false 2015-04-02 2015-04-02 00:00:00 3.141592654 2.036
|
||||
6 32767 3021 123456 604587.000 true 2014-11-11 2015-03-13 12:36:38 2014-11-11 2015-03-13 12:36:38.111111 2015-03-13 12:36:38.111111 2015-03-13 12:36:38.111111 yanhuiacng01 0.1 80699
|
||||
10 1991 5014 9223372036854775807 -258.369 false 2015-04-02 2013-04-02 15:16:52 2015-04-02 2013-04-02 15:16:52.111111 2013-04-02 15:16:52.111111 2013-04-02 15:16:52.111111 wangyu14 -123456.54 0.235
|
||||
12 32767 -2147483647 9223372036854775807 243.325 false 1991-08-11 2013-04-02 15:16:52 1991-08-11 2013-04-02 15:16:52.111111 2013-04-02 15:16:52.111111 2013-04-02 15:16:52.111111 liuyuantuo -564.898 3.1415927
|
||||
1 1989 1001 11011902 123.123 true 1989-03-21 1989-03-21 13:00:00 1989-03-21 1989-03-21 13:00:00.111111 1989-03-21 13:00:00.111111 1989-03-21 13:00:00.111111 wangjing04 0.1 6.333
|
||||
2 1986 1001 11011903 1243.500 false 1901-12-31 1989-03-21 13:00:00 1901-12-31 1989-03-21 13:00:00.111111 1989-03-21 13:00:00.111111 1989-03-21 13:00:00.111111 wangyu14 20.268 789.25
|
||||
4 1991 3021 -11011907 243243.325 false 3124-10-10 2015-03-13 10:30:00 3124-10-10 2015-03-13 10:30:00.111111 2015-03-13 10:30:00.111111 2015-03-13 10:30:00.111111 yanhuicang01 2.06 -0.001
|
||||
5 1985 5014 -11011903 243.325 true 2015-01-01 2015-03-13 12:36:38 2015-01-01 2015-03-13 12:36:38.111111 2015-03-13 12:36:38.111111 2015-03-13 12:36:38.111111 duyunkai@123 -0 -365
|
||||
15 1992 3021 11011920 0.000 true 9999-12-12 2015-04-02 00:00:00 9999-12-12 2015-04-02 00:00:00.111111 2015-04-02 00:00:00.111111 2015-04-02 00:00:00.111111 3.141592653 20.456
|
||||
3 1989 1002 11011905 24453.325 false 2012-03-14 2000-01-01 00:00:00 2012-03-14 2000-01-01 00:00:00.111111 2000-01-01 00:00:00.111111 2000-01-01 00:00:00.111111 yuanyuan06 78945 3654
|
||||
7 -32767 1002 7210457 3.141 false 1988-03-21 1901-01-01 00:00:00 1988-03-21 1901-01-01 00:00:00.111111 1901-01-01 00:00:00.111111 1901-01-01 00:00:00.111111 jingyong 0 6058
|
||||
8 255 2147483647 11011920 -0.123 true 1989-03-21 9999-11-11 12:12:00 1989-03-21 9999-11-11 12:12:00.111111 9999-11-11 12:12:00.111111 9999-11-11 12:12:00.111111 wangjing05 987456.123 12.14
|
||||
9 1991 -2147483647 11011902 -654.654 true 1991-08-11 1989-03-21 13:11:00 1991-08-11 1989-03-21 13:11:00.111111 1989-03-21 13:11:00.111111 1989-03-21 13:11:00.111111 wangjing04 0 69.123
|
||||
11 1989 25699 -9223372036854775807 0.666 true 2015-04-02 1989-03-21 13:11:00 2015-04-02 1989-03-21 13:11:00.111111 1989-03-21 13:11:00.111111 1989-03-21 13:11:00.111111 yuanyuan06 -987.001 4.336
|
||||
13 -32767 2147483647 -9223372036854775807 100.001 false 2015-04-02 2015-04-02 00:00:00 2015-04-02 2015-04-02 00:00:00.111111 2015-04-02 00:00:00.111111 2015-04-02 00:00:00.111111 weike01 123.456 3.1415927
|
||||
14 255 103 11011902 0.000 false 2015-04-02 2015-04-02 00:00:00 2015-04-02 2015-04-02 00:00:00.111111 2015-04-02 00:00:00.111111 2015-04-02 00:00:00.111111 3.141592654 2.036
|
||||
|
||||
|
@ -35,6 +35,114 @@ JDR 2014-10-06T00:00 14.03 12.55
|
||||
JDR 2014-10-07T00:00 14.75 14.03
|
||||
JDR 2014-10-08T00:00 13.98 14.75
|
||||
|
||||
-- !sql --
|
||||
JDR 2014-10-02T00:00 12.86 12.875
|
||||
JDR 2014-10-03T00:00 12.89 12.896666667
|
||||
JDR 2014-10-04T00:00 12.94 12.793333333
|
||||
JDR 2014-10-05T00:00 12.55 13.173333333
|
||||
JDR 2014-10-06T00:00 14.03 13.776666667
|
||||
JDR 2014-10-07T00:00 14.75 14.253333333
|
||||
JDR 2014-10-08T00:00 13.98 14.365
|
||||
|
||||
-- !sql --
|
||||
JDR 2014-10-02T00:00 12.86 higher
|
||||
JDR 2014-10-03T00:00 12.89 higher
|
||||
JDR 2014-10-04T00:00 12.94 flat or lower
|
||||
JDR 2014-10-05T00:00 12.55 higher
|
||||
JDR 2014-10-06T00:00 14.03 higher
|
||||
JDR 2014-10-07T00:00 14.75 flat or lower
|
||||
JDR 2014-10-08T00:00 13.98 flat or lower
|
||||
|
||||
-- !sql --
|
||||
2014-10-07T00:00
|
||||
2014-10-06T00:00
|
||||
2014-10-05T00:00
|
||||
2014-10-04T00:00
|
||||
2014-10-03T00:00
|
||||
2014-10-02T00:00
|
||||
2014-10-02T00:00
|
||||
|
||||
-- !sql --
|
||||
JDR 2014-10-02T00:00 12.86 0
|
||||
JDR 2014-10-03T00:00 12.89 12.86
|
||||
JDR 2014-10-04T00:00 12.94 12.89
|
||||
JDR 2014-10-05T00:00 12.55 12.94
|
||||
JDR 2014-10-06T00:00 14.03 12.55
|
||||
JDR 2014-10-07T00:00 14.75 14.03
|
||||
JDR 2014-10-08T00:00 13.98 14.75
|
||||
|
||||
-- !sql --
|
||||
JDR 2014-10-02T00:00:00.111 12.86 12.875
|
||||
JDR 2014-10-03T00:00:00.111 12.89 12.896666667
|
||||
JDR 2014-10-04T00:00:00.111 12.94 12.793333333
|
||||
JDR 2014-10-05T00:00:00.111 12.55 13.173333333
|
||||
JDR 2014-10-06T00:00:00.111 14.03 13.776666667
|
||||
JDR 2014-10-07T00:00:00.111 14.75 14.253333333
|
||||
JDR 2014-10-08T00:00:00.111 13.98 14.365
|
||||
|
||||
-- !sql --
|
||||
JDR 2014-10-02T00:00:00.111 12.86 higher
|
||||
JDR 2014-10-03T00:00:00.111 12.89 higher
|
||||
JDR 2014-10-04T00:00:00.111 12.94 flat or lower
|
||||
JDR 2014-10-05T00:00:00.111 12.55 higher
|
||||
JDR 2014-10-06T00:00:00.111 14.03 higher
|
||||
JDR 2014-10-07T00:00:00.111 14.75 flat or lower
|
||||
JDR 2014-10-08T00:00:00.111 13.98 flat or lower
|
||||
|
||||
-- !sql --
|
||||
2014-10-07T00:00
|
||||
2014-10-06T00:00
|
||||
2014-10-05T00:00
|
||||
2014-10-04T00:00
|
||||
2014-10-03T00:00
|
||||
2014-10-02T00:00
|
||||
2014-10-02T00:00
|
||||
|
||||
-- !sql --
|
||||
JDR 2014-10-02T00:00:00.111 12.86 0
|
||||
JDR 2014-10-03T00:00:00.111 12.89 12.86
|
||||
JDR 2014-10-04T00:00:00.111 12.94 12.89
|
||||
JDR 2014-10-05T00:00:00.111 12.55 12.94
|
||||
JDR 2014-10-06T00:00:00.111 14.03 12.55
|
||||
JDR 2014-10-07T00:00:00.111 14.75 14.03
|
||||
JDR 2014-10-08T00:00:00.111 13.98 14.75
|
||||
|
||||
-- !sql --
|
||||
JDR 2014-10-02T00:00:00.111111 12.86 12.875
|
||||
JDR 2014-10-03T00:00:00.111111 12.89 12.896666667
|
||||
JDR 2014-10-04T00:00:00.111111 12.94 12.793333333
|
||||
JDR 2014-10-05T00:00:00.111111 12.55 13.173333333
|
||||
JDR 2014-10-06T00:00:00.111111 14.03 13.776666667
|
||||
JDR 2014-10-07T00:00:00.111111 14.75 14.253333333
|
||||
JDR 2014-10-08T00:00:00.111111 13.98 14.365
|
||||
|
||||
-- !sql --
|
||||
JDR 2014-10-02T00:00:00.111111 12.86 higher
|
||||
JDR 2014-10-03T00:00:00.111111 12.89 higher
|
||||
JDR 2014-10-04T00:00:00.111111 12.94 flat or lower
|
||||
JDR 2014-10-05T00:00:00.111111 12.55 higher
|
||||
JDR 2014-10-06T00:00:00.111111 14.03 higher
|
||||
JDR 2014-10-07T00:00:00.111111 14.75 flat or lower
|
||||
JDR 2014-10-08T00:00:00.111111 13.98 flat or lower
|
||||
|
||||
-- !sql --
|
||||
2014-10-07T00:00
|
||||
2014-10-06T00:00
|
||||
2014-10-05T00:00
|
||||
2014-10-04T00:00
|
||||
2014-10-03T00:00
|
||||
2014-10-02T00:00
|
||||
2014-10-02T00:00
|
||||
|
||||
-- !sql --
|
||||
JDR 2014-10-02T00:00:00.111111 12.86 0
|
||||
JDR 2014-10-03T00:00:00.111111 12.89 12.86
|
||||
JDR 2014-10-04T00:00:00.111111 12.94 12.89
|
||||
JDR 2014-10-05T00:00:00.111111 12.55 12.94
|
||||
JDR 2014-10-06T00:00:00.111111 14.03 12.55
|
||||
JDR 2014-10-07T00:00:00.111111 14.75 14.03
|
||||
JDR 2014-10-08T00:00:00.111111 13.98 14.75
|
||||
|
||||
-- !sql --
|
||||
2 even 6
|
||||
4 even 12
|
||||
|
||||
13
regression-test/data/rollup/test_materialized_view_date.out
Normal file
13
regression-test/data/rollup/test_materialized_view_date.out
Normal file
@ -0,0 +1,13 @@
|
||||
-- This file is automatically generated. You should know what you did if you want to edit this
|
||||
-- !sql --
|
||||
1 2020-05-30
|
||||
|
||||
-- !sql --
|
||||
1 2020-05-30T11:11:11
|
||||
|
||||
-- !sql --
|
||||
1 2020-05-30T11:11:11.111
|
||||
|
||||
-- !sql --
|
||||
1 2020-05-30T11:11:11.111111
|
||||
|
||||
26
regression-test/data/rollup/test_rollup_agg_date.out
Normal file
26
regression-test/data/rollup/test_rollup_agg_date.out
Normal file
@ -0,0 +1,26 @@
|
||||
-- This file is automatically generated. You should know what you did if you want to edit this
|
||||
-- !sql --
|
||||
test_rollup_agg AGG_KEYS datek1 DATEV2 Yes true \N true
|
||||
datetimek1 DATETIMEV2(0) Yes true \N true
|
||||
datetimek2 DATETIMEV2(3) Yes true \N true
|
||||
datetimek3 DATETIMEV2(6) Yes true \N true
|
||||
datev1 DATEV2 No false \N MAX true
|
||||
datetimev1 DATETIMEV2(0) No false \N MAX true
|
||||
datetimev2 DATETIMEV2(3) No false \N MAX true
|
||||
datetimev3 DATETIMEV2(6) No false \N MAX true
|
||||
datetimev4 DATETIMEV2(3) Yes false \N MAX true
|
||||
|
||||
rollup_date AGG_KEYS datek1 DATEV2 Yes true \N true
|
||||
datetimek1 DATETIMEV2(0) Yes true \N true
|
||||
datetimek2 DATETIMEV2(3) Yes true \N true
|
||||
datetimek3 DATETIMEV2(6) Yes true \N true
|
||||
datev1 DATEV2 No false \N MAX true
|
||||
datetimev1 DATETIMEV2(0) No false \N MAX true
|
||||
datetimev2 DATETIMEV2(3) No false \N MAX true
|
||||
datetimev3 DATETIMEV2(6) No false \N MAX true
|
||||
datetimev4 DATETIMEV2(3) Yes false \N MAX true
|
||||
|
||||
-- !sql --
|
||||
2022-08-23 2022-08-23T11:11:11 2022-08-23T11:11:11.111 2022-08-23T11:11:11.111111 2022-08-23 2022-08-23T11:11:11 2022-08-23T11:11:11.111 2022-08-23T11:11:11.111111
|
||||
2022-08-22 2022-08-22T11:11:11 2022-08-22T11:11:11.111 2022-08-22T11:11:11.111111 2022-08-22 2022-08-22T11:11:11 2022-08-22T11:11:11.111 2022-08-22T11:11:11.111111
|
||||
|
||||
@ -30,7 +30,11 @@ suite("test_create_table_with_bloom_filter") {
|
||||
decimal_key DECIMAL(20, 6) NOT NULL,
|
||||
decimal_most_key DECIMAL(27, 9) NOT NULL,
|
||||
date_key DATE NOT NULL,
|
||||
datetime_key DATETIME NOT NULL,
|
||||
datetime_key DATETIME NOT NULL,
|
||||
datev2_key DATEV2 NOT NULL,
|
||||
datetimev2_key_1 DATETIMEV2 NOT NULL,
|
||||
datetimev2_key_2 DATETIMEV2(3) NOT NULL,
|
||||
datetimev2_key_3 DATETIMEV2(6) NOT NULL,
|
||||
tinyint_value TINYINT SUM NOT NULL,
|
||||
smallint_value SMALLINT SUM NOT NULL,
|
||||
int_value int SUM NOT NULL,
|
||||
@ -46,7 +50,19 @@ suite("test_create_table_with_bloom_filter") {
|
||||
date_value_min DATE MIN NOT NULL,
|
||||
datetime_value_max DATETIME MAX NOT NULL,
|
||||
datetime_value_replace DATETIME REPLACE NOT NULL,
|
||||
datetime_value_min DATETIME MIN NOT NULL,
|
||||
datetime_value_min DATETIME MIN NOT NULL,
|
||||
datev2_value_max DATEV2 MAX NOT NULL,
|
||||
datev2_value_replace DATEV2 REPLACE NOT NULL,
|
||||
datev2_value_min DATEV2 MIN NOT NULL,
|
||||
datetimev2_value_1_max DATETIMEV2 MAX NOT NULL,
|
||||
datetimev2_value_1_replace DATETIMEV2 REPLACE NOT NULL,
|
||||
datetimev2_value_1_min DATETIMEV2 MIN NOT NULL,
|
||||
datetimev2_value_2_max DATETIMEV2(3) MAX NOT NULL,
|
||||
datetimev2_value_2_replace DATETIMEV2(3) REPLACE NOT NULL,
|
||||
datetimev2_value_2_min DATETIMEV2(3) MIN NOT NULL,
|
||||
datetimev2_value_3_max DATETIMEV2(6) MAX NOT NULL,
|
||||
datetimev2_value_3_replace DATETIMEV2(6) REPLACE NOT NULL,
|
||||
datetimev2_value_3_min DATETIMEV2(6) MIN NOT NULL,
|
||||
float_value FLOAT SUM NOT NULL,
|
||||
double_value DOUBLE SUM NOT NULL )
|
||||
AGGREGATE KEY(
|
||||
@ -61,23 +77,32 @@ suite("test_create_table_with_bloom_filter") {
|
||||
decimal_key,
|
||||
decimal_most_key,
|
||||
date_key,
|
||||
datetime_key)
|
||||
datetime_key,
|
||||
datev2_key,
|
||||
datetimev2_key_1,
|
||||
datetimev2_key_2,
|
||||
datetimev2_key_3)
|
||||
DISTRIBUTED BY HASH(tinyint_key) BUCKETS 5
|
||||
PROPERTIES (
|
||||
"bloom_filter_columns"="smallint_key,int_key,bigint_key,char_50_key,character_key,
|
||||
char_key,character_most_key,decimal_key,decimal_most_key,
|
||||
date_key,datetime_key",
|
||||
date_key,datetime_key,datev2_key, datetimev2_key_1, datetimev2_key_2, datetimev2_key_3",
|
||||
"replication_num" = "1"
|
||||
)
|
||||
"""
|
||||
sql """
|
||||
INSERT INTO test_bloom_filter VALUES
|
||||
('1', '2', '4', '8', '50string', '500varchar', 'c', '65535varchar',
|
||||
'0', '123456789012345678.123456789', '2013-12-01', '1900-01-01 00:00:00',
|
||||
'1', '2', '4', '8', '50string', '500varchar_replace', 'c', '65535varchar',
|
||||
'12345678901234.123456', '123456789012345678.123456789', '1900-01-01',
|
||||
'1900-01-01', '1900-01-01', '1900-01-01 00:00:00', '1900-01-01 00:00:00',
|
||||
'1900-01-01 00:00:00', '0.4', '0.8')
|
||||
'0', '123456789012345678.123456789', '2013-12-01', '1900-01-01 00:00:00',
|
||||
'2013-12-01', '1900-01-01 00:00:00.111111',
|
||||
'1900-01-01 00:00:00.111111', '1900-01-01 00:00:00.111111',
|
||||
'1', '2', '4', '8', '50string', '500varchar_replace',
|
||||
'c', '65535varchar', '12345678901234.123456', '123456789012345678.123456789',
|
||||
'1900-01-01', '1900-01-01', '1900-01-01', '1900-01-01 00:00:00', '1900-01-01 00:00:00',
|
||||
'1900-01-01 00:00:00', '2013-12-01', '2013-12-01', '2013-12-01', '1900-01-01 00:00:00.111111',
|
||||
'1900-01-01 00:00:00.111111', '1900-01-01 00:00:00.111111', '1900-01-01 00:00:00.111111',
|
||||
'1900-01-01 00:00:00.111111', '1900-01-01 00:00:00.111111', '1900-01-01 00:00:00.111111',
|
||||
'1900-01-01 00:00:00.111111', '1900-01-01 00:00:00.111111', '0.4', '0.8')
|
||||
"""
|
||||
qt_select_tb "SELECT * FROM test_bloom_filter"
|
||||
qt_desc_tb "DESC test_bloom_filter"
|
||||
|
||||
@ -112,4 +112,40 @@ suite("create_table_use_partion_policy") {
|
||||
sql """
|
||||
DROP TABLE create_table_partion_use_created_policy
|
||||
"""
|
||||
|
||||
def create_table_partition_use_created_policy_1 = try_sql """
|
||||
CREATE TABLE create_table_partion_use_created_policy_1
|
||||
(
|
||||
k1 DATEV2,
|
||||
k2 INT,
|
||||
V1 VARCHAR(2048) REPLACE
|
||||
) PARTITION BY RANGE (k1) (
|
||||
PARTITION p1 VALUES LESS THAN ("2022-01-01") ("storage_policy" = "test_create_table_partition_use_policy_1" ,"replication_num"="1"),
|
||||
PARTITION p2 VALUES LESS THAN ("2022-02-01") ("storage_policy" = "test_create_table_partition_use_policy_2" ,"replication_num"="1")
|
||||
) DISTRIBUTED BY HASH(k2) BUCKETS 1;
|
||||
"""
|
||||
|
||||
assertEquals(create_table_partition_use_created_policy_1.size(), 1);
|
||||
|
||||
sql """
|
||||
DROP TABLE create_table_partion_use_created_policy_1
|
||||
"""
|
||||
|
||||
def create_table_partition_use_created_policy_2 = try_sql """
|
||||
CREATE TABLE create_table_partion_use_created_policy_2
|
||||
(
|
||||
k1 DATETIMEV2(3),
|
||||
k2 INT,
|
||||
V1 VARCHAR(2048) REPLACE
|
||||
) PARTITION BY RANGE (k1) (
|
||||
PARTITION p1 VALUES LESS THAN ("2022-01-01 00:00:00.111") ("storage_policy" = "test_create_table_partition_use_policy_1" ,"replication_num"="1"),
|
||||
PARTITION p2 VALUES LESS THAN ("2022-02-01 00:00:00.111") ("storage_policy" = "test_create_table_partition_use_policy_2" ,"replication_num"="1")
|
||||
) DISTRIBUTED BY HASH(k2) BUCKETS 1;
|
||||
"""
|
||||
|
||||
assertEquals(create_table_partition_use_created_policy_2.size(), 1);
|
||||
|
||||
sql """
|
||||
DROP TABLE create_table_partion_use_created_policy_2
|
||||
"""
|
||||
}
|
||||
|
||||
@ -62,51 +62,56 @@ suite("test_compaction_agg_keys") {
|
||||
CREATE TABLE ${tableName} (
|
||||
`user_id` LARGEINT NOT NULL COMMENT "用户id",
|
||||
`date` DATE NOT NULL COMMENT "数据灌入日期时间",
|
||||
`datev2` DATEV2 NOT NULL COMMENT "数据灌入日期时间",
|
||||
`datetimev2_1` DATETIMEV2(3) NOT NULL COMMENT "数据灌入日期时间",
|
||||
`datetimev2_2` DATETIMEV2(6) NOT NULL COMMENT "数据灌入日期时间",
|
||||
`city` VARCHAR(20) COMMENT "用户所在城市",
|
||||
`age` SMALLINT COMMENT "用户年龄",
|
||||
`sex` TINYINT COMMENT "用户性别",
|
||||
`last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
|
||||
`last_update_date` DATETIME REPLACE_IF_NOT_NULL DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次更新时间",
|
||||
`datetime_val1` DATETIMEV2(3) REPLACE DEFAULT "1970-01-01 00:00:00.111" COMMENT "用户最后一次访问时间",
|
||||
`datetime_val2` DATETIME(6) REPLACE_IF_NOT_NULL DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次更新时间",
|
||||
`last_visit_date_not_null` DATETIME REPLACE NOT NULL DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
|
||||
`cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",
|
||||
`max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",
|
||||
`min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间",
|
||||
`hll_col` HLL HLL_UNION NOT NULL COMMENT "HLL列",
|
||||
`bitmap_col` Bitmap BITMAP_UNION NOT NULL COMMENT "bitmap列" )
|
||||
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`) DISTRIBUTED BY HASH(`user_id`)
|
||||
AGGREGATE KEY(`user_id`, `date`, `datev2`, `datetimev2_1`, `datetimev2_2`, `city`, `age`, `sex`) DISTRIBUTED BY HASH(`user_id`)
|
||||
PROPERTIES ( "replication_num" = "1" );
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(1, '2017-10-01', 'Beijing', 10, 1, '2020-01-01', '2020-01-01', '2020-01-01', 1, 30, 20, hll_hash(1), to_bitmap(1))
|
||||
(1, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-01', '2020-01-01', '2017-10-01 11:11:11.170000', '2017-10-01 11:11:11.110111', '2020-01-01', 1, 30, 20, hll_hash(1), to_bitmap(1))
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(1, '2017-10-01', 'Beijing', 10, 1, '2020-01-02', '2020-01-02', '2020-01-02', 1, 31, 19, hll_hash(2), to_bitmap(2))
|
||||
(1, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-02', '2020-01-02', '2017-10-01 11:11:11.160000', '2017-10-01 11:11:11.100111', '2020-01-02', 1, 31, 19, hll_hash(2), to_bitmap(2))
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(2, '2017-10-01', 'Beijing', 10, 1, '2020-01-02', '2020-01-02', '2020-01-02', 1, 31, 21, hll_hash(2), to_bitmap(2))
|
||||
(2, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-02', '2020-01-02', '2017-10-01 11:11:11.150000', '2017-10-01 11:11:11.130111', '2020-01-02', 1, 31, 21, hll_hash(2), to_bitmap(2))
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(2, '2017-10-01', 'Beijing', 10, 1, '2020-01-03', '2020-01-03', '2020-01-03', 1, 32, 20, hll_hash(3), to_bitmap(3))
|
||||
(2, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-03', '2020-01-03', '2017-10-01 11:11:11.140000', '2017-10-01 11:11:11.120111', '2020-01-03', 1, 32, 20, hll_hash(3), to_bitmap(3))
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(3, '2017-10-01', 'Beijing', 10, 1, '2020-01-03', '2020-01-03', '2020-01-03', 1, 32, 22, hll_hash(3), to_bitmap(3))
|
||||
(3, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-03', '2020-01-03', '2017-10-01 11:11:11.100000', '2017-10-01 11:11:11.140111', '2020-01-03', 1, 32, 22, hll_hash(3), to_bitmap(3))
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(3, '2017-10-01', 'Beijing', 10, 1, '2020-01-04', '2020-01-04', '2020-01-04', 1, 33, 21, hll_hash(4), to_bitmap(4))
|
||||
(3, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-04', '2020-01-04', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.150111', '2020-01-04', 1, 33, 21, hll_hash(4), to_bitmap(4))
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(3, '2017-10-01', 'Beijing', 10, 1, NULL, NULL, '2020-01-05', 1, 34, 20, hll_hash(5), to_bitmap(5))
|
||||
(3, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, NULL, NULL, NULL, NULL, '2020-01-05', 1, 34, 20, hll_hash(5), to_bitmap(5))
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(4, '2017-10-01', 'Beijing', 10, 1, NULL, NULL, '2020-01-05', 1, 34, 20, hll_hash(5), to_bitmap(5))
|
||||
(4, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, NULL, NULL, NULL, NULL, '2020-01-05', 1, 34, 20, hll_hash(5), to_bitmap(5))
|
||||
"""
|
||||
|
||||
qt_select_default """ SELECT * FROM ${tableName} t ORDER BY user_id; """
|
||||
|
||||
@ -62,49 +62,54 @@ suite("test_compaction_dup_keys") {
|
||||
CREATE TABLE ${tableName} (
|
||||
`user_id` LARGEINT NOT NULL COMMENT "用户id",
|
||||
`date` DATE NOT NULL COMMENT "数据灌入日期时间",
|
||||
`datev2` DATEV2 NOT NULL COMMENT "数据灌入日期时间",
|
||||
`datetimev2_1` DATETIMEV2(3) NOT NULL COMMENT "数据灌入日期时间",
|
||||
`datetimev2_2` DATETIMEV2(6) NOT NULL COMMENT "数据灌入日期时间",
|
||||
`city` VARCHAR(20) COMMENT "用户所在城市",
|
||||
`age` SMALLINT COMMENT "用户年龄",
|
||||
`sex` TINYINT COMMENT "用户性别",
|
||||
`last_visit_date` DATETIME DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
|
||||
`last_update_date` DATETIME DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次更新时间",
|
||||
`datetime_val1` DATETIMEV2(3) DEFAULT "1970-01-01 00:00:00.111" COMMENT "用户最后一次访问时间",
|
||||
`datetime_val2` DATETIME(6) DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次更新时间",
|
||||
`last_visit_date_not_null` DATETIME NOT NULL DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
|
||||
`cost` BIGINT DEFAULT "0" COMMENT "用户总消费",
|
||||
`max_dwell_time` INT DEFAULT "0" COMMENT "用户最大停留时间",
|
||||
`min_dwell_time` INT DEFAULT "99999" COMMENT "用户最小停留时间")
|
||||
DUPLICATE KEY(`user_id`, `date`, `city`, `age`, `sex`) DISTRIBUTED BY HASH(`user_id`)
|
||||
DUPLICATE KEY(`user_id`, `date`, `datev2`, `datetimev2_1`, `datetimev2_2`, `city`, `age`, `sex`) DISTRIBUTED BY HASH(`user_id`)
|
||||
PROPERTIES ( "replication_num" = "1" );
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(1, '2017-10-01', 'Beijing', 10, 1, '2020-01-01', '2020-01-01', '2020-01-01', 1, 30, 20)
|
||||
(1, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-01', '2020-01-01', '2017-10-01 11:11:11.170000', '2017-10-01 11:11:11.110111', '2020-01-01', 1, 30, 20)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(1, '2017-10-01', 'Beijing', 10, 1, '2020-01-02', '2020-01-02', '2020-01-02', 1, 31, 19)
|
||||
(1, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-02', '2020-01-02', '2017-10-01 11:11:11.160000', '2017-10-01 11:11:11.100111', '2020-01-02', 1, 31, 19)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(2, '2017-10-01', 'Beijing', 10, 1, '2020-01-02', '2020-01-02', '2020-01-02', 1, 31, 21)
|
||||
(2, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-02', '2020-01-02', '2017-10-01 11:11:11.150000', '2017-10-01 11:11:11.130111', '2020-01-02', 1, 31, 21)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(2, '2017-10-01', 'Beijing', 10, 1, '2020-01-03', '2020-01-03', '2020-01-03', 1, 32, 20)
|
||||
(2, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-03', '2020-01-03', '2017-10-01 11:11:11.140000', '2017-10-01 11:11:11.120111', '2020-01-03', 1, 32, 20)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(3, '2017-10-01', 'Beijing', 10, 1, '2020-01-03', '2020-01-03', '2020-01-03', 1, 32, 22)
|
||||
(3, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-03', '2020-01-03', '2017-10-01 11:11:11.100000', '2017-10-01 11:11:11.140111', '2020-01-03', 1, 32, 22)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(3, '2017-10-01', 'Beijing', 10, 1, '2020-01-04', '2020-01-04', '2020-01-04', 1, 33, 21)
|
||||
(3, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-04', '2020-01-04', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.150111', '2020-01-04', 1, 33, 21)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(3, '2017-10-01', 'Beijing', 10, 1, NULL, NULL, '2020-01-05', 1, 34, 20)
|
||||
(3, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, NULL, NULL, NULL, NULL, '2020-01-05', 1, 34, 20)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(4, '2017-10-01', 'Beijing', 10, 1, NULL, NULL, '2020-01-05', 1, 34, 20)
|
||||
(4, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, NULL, NULL, NULL, NULL, '2020-01-05', 1, 34, 20)
|
||||
"""
|
||||
|
||||
qt_select_default """ SELECT * FROM ${tableName} t ORDER BY user_id,date,city,age,sex,last_visit_date,last_update_date,last_visit_date_not_null,cost,max_dwell_time,min_dwell_time; """
|
||||
|
||||
@ -62,49 +62,54 @@ suite("test_compaction_uniq_keys") {
|
||||
CREATE TABLE ${tableName} (
|
||||
`user_id` LARGEINT NOT NULL COMMENT "用户id",
|
||||
`date` DATE NOT NULL COMMENT "数据灌入日期时间",
|
||||
`datev2` DATEV2 NOT NULL COMMENT "数据灌入日期时间",
|
||||
`datetimev2_1` DATETIMEV2(3) NOT NULL COMMENT "数据灌入日期时间",
|
||||
`datetimev2_2` DATETIMEV2(6) NOT NULL COMMENT "数据灌入日期时间",
|
||||
`city` VARCHAR(20) COMMENT "用户所在城市",
|
||||
`age` SMALLINT COMMENT "用户年龄",
|
||||
`sex` TINYINT COMMENT "用户性别",
|
||||
`last_visit_date` DATETIME DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
|
||||
`last_update_date` DATETIME DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次更新时间",
|
||||
`datetime_val1` DATETIMEV2(3) DEFAULT "1970-01-01 00:00:00.111" COMMENT "用户最后一次访问时间",
|
||||
`datetime_val2` DATETIME(6) DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次更新时间",
|
||||
`last_visit_date_not_null` DATETIME NOT NULL DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
|
||||
`cost` BIGINT DEFAULT "0" COMMENT "用户总消费",
|
||||
`max_dwell_time` INT DEFAULT "0" COMMENT "用户最大停留时间",
|
||||
`min_dwell_time` INT DEFAULT "99999" COMMENT "用户最小停留时间")
|
||||
UNIQUE KEY(`user_id`, `date`, `city`, `age`, `sex`) DISTRIBUTED BY HASH(`user_id`)
|
||||
UNIQUE KEY(`user_id`, `date`, `datev2`, `datetimev2_1`, `datetimev2_2`, `city`, `age`, `sex`) DISTRIBUTED BY HASH(`user_id`)
|
||||
PROPERTIES ( "replication_num" = "1" );
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(1, '2017-10-01', 'Beijing', 10, 1, '2020-01-01', '2020-01-01', '2020-01-01', 1, 30, 20)
|
||||
(1, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-01', '2020-01-01', '2017-10-01 11:11:11.170000', '2017-10-01 11:11:11.110111', '2020-01-01', 1, 30, 20)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(1, '2017-10-01', 'Beijing', 10, 1, '2020-01-02', '2020-01-02', '2020-01-02', 1, 31, 19)
|
||||
(1, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-02', '2020-01-02', '2017-10-01 11:11:11.160000', '2017-10-01 11:11:11.100111', '2020-01-02', 1, 31, 19)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(2, '2017-10-01', 'Beijing', 10, 1, '2020-01-02', '2020-01-02', '2020-01-02', 1, 31, 21)
|
||||
(2, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-02', '2020-01-02', '2017-10-01 11:11:11.150000', '2017-10-01 11:11:11.130111', '2020-01-02', 1, 31, 21)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(2, '2017-10-01', 'Beijing', 10, 1, '2020-01-03', '2020-01-03', '2020-01-03', 1, 32, 20)
|
||||
(2, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-03', '2020-01-03', '2017-10-01 11:11:11.140000', '2017-10-01 11:11:11.120111', '2020-01-03', 1, 32, 20)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(3, '2017-10-01', 'Beijing', 10, 1, '2020-01-03', '2020-01-03', '2020-01-03', 1, 32, 22)
|
||||
(3, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-03', '2020-01-03', '2017-10-01 11:11:11.100000', '2017-10-01 11:11:11.140111', '2020-01-03', 1, 32, 22)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(3, '2017-10-01', 'Beijing', 10, 1, '2020-01-04', '2020-01-04', '2020-01-04', 1, 33, 21)
|
||||
(3, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, '2020-01-04', '2020-01-04', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.150111', '2020-01-04', 1, 33, 21)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(3, '2017-10-01', 'Beijing', 10, 1, NULL, NULL, '2020-01-05', 1, 34, 20)
|
||||
(3, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, NULL, NULL, NULL, NULL, '2020-01-05', 1, 34, 20)
|
||||
"""
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
(4, '2017-10-01', 'Beijing', 10, 1, NULL, NULL, '2020-01-05', 1, 34, 20)
|
||||
(4, '2017-10-01', '2017-10-01', '2017-10-01 11:11:11.110000', '2017-10-01 11:11:11.110111', 'Beijing', 10, 1, NULL, NULL, NULL, NULL, '2020-01-05', 1, 34, 20)
|
||||
"""
|
||||
|
||||
qt_select_default """ SELECT * FROM ${tableName} t ORDER BY user_id; """
|
||||
|
||||
@ -39,6 +39,10 @@
|
||||
(
|
||||
`stock_code` varchar(100) NULL COMMENT "",
|
||||
`data_time` date NOT NULL COMMENT "",
|
||||
`datev2` datev2 NOT NULL COMMENT "",
|
||||
`datatimev2_1` datetimev2 NOT NULL COMMENT "",
|
||||
`datatimev2_2` datetimev2(3) NOT NULL COMMENT "",
|
||||
`datatimev2_3` datetimev2(6) NOT NULL COMMENT "",
|
||||
`employee` int(11) NULL COMMENT "",
|
||||
`oper_rev` decimal(27, 2) NULL COMMENT "",
|
||||
`net_profit` decimal(27, 2) NULL COMMENT "",
|
||||
@ -57,7 +61,7 @@
|
||||
`capex` decimal(27, 2) NULL COMMENT "",
|
||||
`update_time` datetime NULL COMMENT ""
|
||||
) ENGINE=OLAP
|
||||
UNIQUE KEY(`stock_code`, `data_time`)
|
||||
UNIQUE KEY(`stock_code`, `data_time`, `datev2`, `datatimev2_1`, `datatimev2_2`, `datatimev2_3`)
|
||||
COMMENT ""
|
||||
DISTRIBUTED BY HASH(`stock_code`) BUCKETS 10
|
||||
PROPERTIES (
|
||||
@ -82,12 +86,12 @@
|
||||
"""
|
||||
|
||||
sql """
|
||||
INSERT INTO ods_comp_info_q (stock_code,data_time,employee,oper_rev,net_profit,roe_diluted,roe_forecast1,roe_forecast2,roe_forecast3,segment_sales_industry,segment_sales_product,segment_sales_region,cont_liab,rd_exp,cash_end_bal_cf,deductedprofit,extraordinary,capex,update_time) VALUES
|
||||
('b','2022-08-01',3,705091149953414452.46,747823572268070011.12,27359935448400379.28,499659240437828403.4,328974174261964288.43,224982925762347928.61,'a','b',NULL,699686029559044363.29,NULL,565258647647190196.8,280880206593919322.57,234915543693063635.1,2319457526991656.56,'2022-08-01 00:00:00'),
|
||||
(NULL,'2022-08-01',6,794180259997275010.71,889165000079374948.86,615566875134080159.47,55766577026010060.64,692384373205823149.29,917992076378031973.99,'b','a','a',531161365155959323.76,442733481509055860.8,672559382305200707.53,863561269567335566.38,727794355006653392.98,716698894949586778.75,'2022-08-01 00:00:00'),
|
||||
('e','2022-08-01',4,459847697542436646.78,958176162478193747.23,715826630793028044.88,541967646169735759.63,795134975489939217.17,87108238990117448.77,'e','d','c',807748584393533437.58,895417761167717963.91,591333902513658995.88,66421280517330023.75,939346464324951973.46,490845810509366157.35,'2022-08-01 00:00:00'),
|
||||
('a','2022-08-01',2,587325832204376329.26,875352826279802899.12,399232951346418221.82,414030170209762738.14,671245100753215734.46,13826319122152913.65,'b','a','b',3579634985545821,154791373958795843.54,472864641422522739.74,905921613564175878.11,NULL,553229819135054741.53,'2022-08-01 00:00:00'),
|
||||
('d','2022-08-01',4,35163815958145692.63,106458565436056336.19,NULL,845068137933809321.6,173641241393263805.39,148425884326276338.96,'e','b','c',848579524158656737.66,134243691765872795.44,442037721152552222.33,271698192570079341.11,879629131111041234.86,251623556843023676.15,'2022-08-01 00:00:00');
|
||||
INSERT INTO ods_comp_info_q (stock_code,data_time,`datev2`,`datatimev2_1`,`datatimev2_2`,`datatimev2_3`,employee,oper_rev,net_profit,roe_diluted,roe_forecast1,roe_forecast2,roe_forecast3,segment_sales_industry,segment_sales_product,segment_sales_region,cont_liab,rd_exp,cash_end_bal_cf,deductedprofit,extraordinary,capex,update_time) VALUES
|
||||
('b','2022-08-01','2022-08-01','2022-08-01 11:11:11.111111','2022-08-01 11:11:11.111111','2022-08-01 11:11:11.111111',3,705091149953414452.46,747823572268070011.12,27359935448400379.28,499659240437828403.4,328974174261964288.43,224982925762347928.61,'a','b',NULL,699686029559044363.29,NULL,565258647647190196.8,280880206593919322.57,234915543693063635.1,2319457526991656.56,'2022-08-01 00:00:00'),
|
||||
(NULL,'2022-08-01','2022-08-01','2022-08-01 11:11:11.111111','2022-08-01 11:11:11.111111','2022-08-01 11:11:11.111111',6,794180259997275010.71,889165000079374948.86,615566875134080159.47,55766577026010060.64,692384373205823149.29,917992076378031973.99,'b','a','a',531161365155959323.76,442733481509055860.8,672559382305200707.53,863561269567335566.38,727794355006653392.98,716698894949586778.75,'2022-08-01 00:00:00'),
|
||||
('e','2022-08-01','2022-08-01','2022-08-01 11:11:11.111111','2022-08-01 11:11:11.111111','2022-08-01 11:11:11.111111',4,459847697542436646.78,958176162478193747.23,715826630793028044.88,541967646169735759.63,795134975489939217.17,87108238990117448.77,'e','d','c',807748584393533437.58,895417761167717963.91,591333902513658995.88,66421280517330023.75,939346464324951973.46,490845810509366157.35,'2022-08-01 00:00:00'),
|
||||
('a','2022-08-01','2022-08-01','2022-08-01 11:11:11.111111','2022-08-01 11:11:11.111111','2022-08-01 11:11:11.111111',2,587325832204376329.26,875352826279802899.12,399232951346418221.82,414030170209762738.14,671245100753215734.46,13826319122152913.65,'b','a','b',3579634985545821,154791373958795843.54,472864641422522739.74,905921613564175878.11,NULL,553229819135054741.53,'2022-08-01 00:00:00'),
|
||||
('d','2022-08-01','2022-08-01','2022-08-01 11:11:11.111111','2022-08-01 11:11:11.111111','2022-08-01 11:11:11.111111',4,35163815958145692.63,106458565436056336.19,NULL,845068137933809321.6,173641241393263805.39,148425884326276338.96,'e','b','c',848579524158656737.66,134243691765872795.44,442037721152552222.33,271698192570079341.11,879629131111041234.86,251623556843023676.15,'2022-08-01 00:00:00');
|
||||
"""
|
||||
|
||||
order_qt_select """
|
||||
@ -100,5 +104,45 @@
|
||||
from temp tt1
|
||||
left join temp tt2 on tt2.data_time = tt1.data_time order by tt1.data_time;
|
||||
"""
|
||||
order_qt_select """
|
||||
with temp as (select
|
||||
t2.`datev2`
|
||||
from dim_comp_tags t1
|
||||
left join ods_comp_info_q t2 on t2.stock_code = t1.stock_code
|
||||
group by t2.`datev2`)
|
||||
select tt1.`datev2`
|
||||
from temp tt1
|
||||
left join temp tt2 on tt2.`datev2` = tt1.`datev2` order by tt1.`datev2`;
|
||||
"""
|
||||
order_qt_select """
|
||||
with temp as (select
|
||||
t2.`datatimev2_1`
|
||||
from dim_comp_tags t1
|
||||
left join ods_comp_info_q t2 on t2.stock_code = t1.stock_code
|
||||
group by t2.`datatimev2_1`)
|
||||
select tt1.`datatimev2_1`
|
||||
from temp tt1
|
||||
left join temp tt2 on tt2.`datatimev2_1` = tt1.`datatimev2_1` order by tt1.`datatimev2_1`;
|
||||
"""
|
||||
order_qt_select """
|
||||
with temp as (select
|
||||
t2.`datatimev2_2`
|
||||
from dim_comp_tags t1
|
||||
left join ods_comp_info_q t2 on t2.stock_code = t1.stock_code
|
||||
group by t2.`datatimev2_2`)
|
||||
select tt1.`datatimev2_2`
|
||||
from temp tt1
|
||||
left join temp tt2 on tt2.`datatimev2_2` = tt1.`datatimev2_2` order by tt1.`datatimev2_2`;
|
||||
"""
|
||||
order_qt_select """
|
||||
with temp as (select
|
||||
t2.`datatimev2_3`
|
||||
from dim_comp_tags t1
|
||||
left join ods_comp_info_q t2 on t2.stock_code = t1.stock_code
|
||||
group by t2.`datatimev2_3`)
|
||||
select tt1.`datatimev2_3`
|
||||
from temp tt1
|
||||
left join temp tt2 on tt2.`datatimev2_3` = tt1.`datatimev2_3` order by tt1.`datatimev2_3`;
|
||||
"""
|
||||
}
|
||||
|
||||
|
||||
@ -25,7 +25,13 @@ suite("test_current_timestamp") {
|
||||
id TINYINT,
|
||||
name CHAR(10) NOT NULL DEFAULT "zs",
|
||||
dt_0 DATETIME,
|
||||
dt_1 DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
dt_2 DATETIMEV2,
|
||||
dt_4 DATETIMEV2(3),
|
||||
dt_6 DATETIMEV2(6),
|
||||
dt_1 DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
dt_3 DATETIMEV2 DEFAULT CURRENT_TIMESTAMP,
|
||||
dt_5 DATETIMEV2(3) DEFAULT CURRENT_TIMESTAMP,
|
||||
dt_7 DATETIMEV2(6) DEFAULT CURRENT_TIMESTAMP
|
||||
)
|
||||
COMMENT "test current_timestamp table"
|
||||
DISTRIBUTED BY HASH(id)
|
||||
@ -33,23 +39,29 @@ suite("test_current_timestamp") {
|
||||
"""
|
||||
|
||||
// test insert into.
|
||||
sql " insert into ${tableName} (id,name,dt_0) values (1,'aa',current_timestamp()); "
|
||||
sql " insert into ${tableName} (id,name,dt_0) values (2,'bb',current_timestamp()); "
|
||||
sql " insert into ${tableName} (id,name,dt_0) values (3,'cc',current_timestamp()); "
|
||||
sql " insert into ${tableName} (id,name,dt_0) values (4,'dd',current_timestamp()); "
|
||||
sql " insert into ${tableName} (id,name,dt_0,dt_2,dt_4,dt_6) values (1,'aa',current_timestamp(),current_timestamp(),current_timestamp(),current_timestamp()); "
|
||||
sql " insert into ${tableName} (id,name,dt_0,dt_2,dt_4,dt_6) values (2,'bb',current_timestamp(),current_timestamp(),current_timestamp(),current_timestamp()); "
|
||||
sql " insert into ${tableName} (id,name,dt_0,dt_2,dt_4,dt_6) values (3,'cc',current_timestamp(),current_timestamp(),current_timestamp(),current_timestamp()); "
|
||||
sql " insert into ${tableName} (id,name,dt_0,dt_2,dt_4,dt_6) values (4,'dd',current_timestamp(),current_timestamp(),current_timestamp(),current_timestamp()); "
|
||||
|
||||
qt_insert_into """ select count(*) from ${tableName} where to_date(dt_0) = to_date(dt_1); """
|
||||
qt_insert_into """ select count(*) from ${tableName} where to_date(dt_2) = to_date(dt_3); """
|
||||
qt_insert_into """ select count(*) from ${tableName} where to_date(dt_4) = to_date(dt_5); """
|
||||
qt_insert_into """ select count(*) from ${tableName} where to_date(dt_6) = to_date(dt_7); """
|
||||
|
||||
// test stream load.
|
||||
streamLoad {
|
||||
table "${tableName}"
|
||||
|
||||
set 'column_separator', ','
|
||||
set 'columns', 'id, name, dt_0 = current_timestamp()'
|
||||
set 'columns', 'id, name, dt_0 = current_timestamp(), dt_2 = current_timestamp(), dt_4 = current_timestamp(), dt_6 = current_timestamp()'
|
||||
|
||||
file 'test_current_timestamp_streamload.csv'
|
||||
|
||||
time 10000 // limit inflight 10s
|
||||
}
|
||||
qt_stream_load """ select count(*) from ${tableName} where id > 4 and to_date(dt_0) = to_date(dt_1); """
|
||||
qt_stream_load """ select count(*) from ${tableName} where id > 4 and to_date(dt_2) = to_date(dt_3); """
|
||||
qt_stream_load """ select count(*) from ${tableName} where id > 4 and to_date(dt_4) = to_date(dt_5); """
|
||||
qt_stream_load """ select count(*) from ${tableName} where id > 4 and to_date(dt_6) = to_date(dt_7); """
|
||||
}
|
||||
|
||||
@ -80,12 +80,16 @@ suite("test_csv_with_header") {
|
||||
def result1 = sql """
|
||||
CREATE TABLE `${testTable}` (
|
||||
`event_day` date NULL COMMENT "",
|
||||
`event_day1` datev2 NULL COMMENT "",
|
||||
`event_day2` datetimev2 NULL COMMENT "",
|
||||
`event_day3` datetimev2(3) NULL COMMENT "",
|
||||
`event_day4` datetimev2(6) NULL COMMENT "",
|
||||
`siteid` int(11) NULL DEFAULT "10" COMMENT "",
|
||||
`citycode` smallint(6) NULL COMMENT "",
|
||||
`username` varchar(32) NULL DEFAULT "" COMMENT "",
|
||||
`pv` bigint(20) NULL DEFAULT "0" COMMENT ""
|
||||
) ENGINE=OLAP
|
||||
DUPLICATE KEY(`event_day`, `siteid`, `citycode`)
|
||||
DUPLICATE KEY(`event_day`, `event_day1`, `event_day2`, `event_day3`, `event_day4`, `siteid`, `citycode`)
|
||||
COMMENT "OLAP"
|
||||
DISTRIBUTED BY HASH(`siteid`) BUCKETS 10
|
||||
PROPERTIES (
|
||||
|
||||
@ -71,14 +71,30 @@ suite("test_aggregate_table") {
|
||||
date_value_max date max,
|
||||
date_value_min date min,
|
||||
date_value_replace date replace,
|
||||
date_value_replace_if_not_null date replace_if_not_null
|
||||
date_value_replace_if_not_null date replace_if_not_null,
|
||||
datev2_value_max datev2 max,
|
||||
datev2_value_min datev2 min,
|
||||
datev2_value_replace datev2 replace,
|
||||
datev2_value_replace_if_not_null datev2 replace_if_not_null,
|
||||
datetimev2_value_max datetimev2 max,
|
||||
datetimev2_value_min datetimev2 min,
|
||||
datetimev2_value_replace datetimev2 replace,
|
||||
datetimev2_value_replace_if_not_null datetimev2 replace_if_not_null,
|
||||
datetimev2_value_max_1 datetimev2(3) max,
|
||||
datetimev2_value_min_1 datetimev2(3) min,
|
||||
datetimev2_value_replace_1 datetimev2(3) replace,
|
||||
datetimev2_value_replace_if_not_null_1 datetimev2(3) replace_if_not_null,
|
||||
datetimev2_value_max_2 datetimev2(6) max,
|
||||
datetimev2_value_min_2 datetimev2(6) min,
|
||||
datetimev2_value_replace_2 datetimev2(6) replace,
|
||||
datetimev2_value_replace_if_not_null_2 datetimev2(6) replace_if_not_null
|
||||
)
|
||||
AGGREGATE KEY(k)
|
||||
DISTRIBUTED BY HASH(k) BUCKETS 5 properties("replication_num" = "1");
|
||||
"""
|
||||
sql """insert into date_agg values(0, '2000-01-01', '2000-01-01', '2000-01-01', '2000-01-01')"""
|
||||
sql """insert into date_agg values(0, '2000-12-31', '2000-12-31', '2000-12-31', '2000-12-31')"""
|
||||
sql """insert into date_agg values(0, null, null, null, null)"""
|
||||
sql """insert into date_agg values(0, '2000-01-01', '2000-01-01', '2000-01-01', '2000-01-01', '2000-01-01', '2000-01-01', '2000-01-01', '2000-01-01', '2000-01-01 11:11:11.111111', '2000-01-01 11:11:11.111111', '2000-01-01 11:11:11.111111', '2000-01-01 11:11:11.111111', '2000-01-01 11:11:11.111111', '2000-01-01 11:11:11.111111', '2000-01-01 11:11:11.111111', '2000-01-01 11:11:11.111111', '2000-01-01 11:11:11.111111', '2000-01-01 11:11:11.111111', '2000-01-01 11:11:11.111111', '2000-01-01 11:11:11.111111') """
|
||||
sql """insert into date_agg values(0, '2000-12-31', '2000-12-31', '2000-12-31', '2000-12-31', '2000-12-31', '2000-12-31', '2000-12-31', '2000-12-31', '2000-12-31 11:11:11.111111', '2000-12-31 11:11:11.111111', '2000-12-31 11:11:11.111111', '2000-12-31 11:11:11.111111', '2000-12-31 11:11:11.111111', '2000-12-31 11:11:11.111111', '2000-12-31 11:11:11.111111', '2000-12-31 11:11:11.111111', '2000-12-31 11:11:11.111111', '2000-12-31 11:11:11.111111', '2000-12-31 11:11:11.111111', '2000-12-31 11:11:11.111111') """
|
||||
sql """insert into date_agg values(0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null) """
|
||||
qt_date_agg_table """select * from date_agg"""
|
||||
qt_desc_date_table """desc date_agg"""
|
||||
sql """DROP TABLE date_agg"""
|
||||
|
||||
@ -26,7 +26,10 @@ CREATE TABLE `${table1}` (
|
||||
`siteid` int(11) NOT NULL COMMENT "",
|
||||
`date1` date NOT NULL COMMENT "",
|
||||
`date2` date NOT NULL COMMENT "",
|
||||
`date3` date NOT NULL COMMENT ""
|
||||
`date3` date NOT NULL COMMENT "",
|
||||
`date4` datev2 NOT NULL COMMENT "",
|
||||
`date5` datev2 NOT NULL COMMENT "",
|
||||
`date6` datev2 NOT NULL COMMENT ""
|
||||
) ENGINE=OLAP
|
||||
DUPLICATE KEY(`siteid`)
|
||||
COMMENT "OLAP"
|
||||
@ -38,11 +41,11 @@ PROPERTIES (
|
||||
)
|
||||
"""
|
||||
|
||||
sql """insert into ${table1} values(1, '2021-04-01', '2021-04-02', '2021-04-03'),
|
||||
(1, '2021-03-01', '2021-03-02', '2021-03-03'),
|
||||
(1, '2021-02-01', '2021-02-02', '2021-02-03'),
|
||||
(1, '2021-01-01', '2021-01-02', '2021-01-03')
|
||||
"""
|
||||
sql """insert into ${table1} values(1, '2021-04-01', '2021-04-02', '2021-04-03', '2021-04-01', '2021-04-02', '2021-04-03'),
|
||||
(1, '2021-03-01', '2021-03-02', '2021-03-03', '2021-03-01', '2021-03-02', '2021-03-03'),
|
||||
(1, '2021-02-01', '2021-02-02', '2021-02-03', '2021-02-01', '2021-02-02', '2021-02-03'),
|
||||
(1, '2021-01-01', '2021-01-02', '2021-01-03', '2021-01-01', '2021-01-02', '2021-01-03')
|
||||
"""
|
||||
|
||||
qt_sql1 "select date1 from ${table1} order by date1"
|
||||
|
||||
@ -62,5 +65,21 @@ PROPERTIES (
|
||||
// not in pred
|
||||
qt_select_not_in_pred_1 "select date1 from ${table1} where date1 not in ('2021-01-01') order by date1"
|
||||
|
||||
// read single column
|
||||
qt_select_1_column "select date4 from ${table1} order by date4"
|
||||
|
||||
// date as pred
|
||||
qt_select_pred_1 "select date4 from ${table1} where date4='2021-03-01'"
|
||||
qt_select_pred_2 "select date4 from ${table1} where date4='2021-04-01'"
|
||||
qt_select_pred_3 "select date5,date4 from ${table1} where date4='2021-04-01'"
|
||||
|
||||
|
||||
// in pred
|
||||
qt_select_in_pred_1 "select date4 from ${table1} where date4 in ('2021-01-01')"
|
||||
qt_select_in_pred_2 "select * from ${table1} where date4 in ('2021-01-01')"
|
||||
|
||||
// not in pred
|
||||
qt_select_not_in_pred_1 "select date4 from ${table1} where date4 not in ('2021-01-01') order by date4"
|
||||
|
||||
sql "drop table if exists ${table1}"
|
||||
}
|
||||
|
||||
@ -26,7 +26,10 @@ CREATE TABLE `${table1}` (
|
||||
`siteid` int(11) NULL COMMENT "",
|
||||
`date1` date NULL COMMENT "",
|
||||
`date2` date NULL COMMENT "",
|
||||
`date3` date NULL COMMENT ""
|
||||
`date3` date NULL COMMENT "",
|
||||
`date4` datev2 NULL COMMENT "",
|
||||
`date5` datev2 NULL COMMENT "",
|
||||
`date6` datev2 NULL COMMENT ""
|
||||
) ENGINE=OLAP
|
||||
DUPLICATE KEY(`siteid`)
|
||||
COMMENT "OLAP"
|
||||
@ -39,17 +42,15 @@ PROPERTIES (
|
||||
|
||||
"""
|
||||
|
||||
sql "set enable_vectorized_engine = false"
|
||||
sql "set enable_vectorized_engine = true"
|
||||
|
||||
sql """insert into ${table1} values
|
||||
(1, '2021-04-01', '2021-04-02', '2021-04-03'),
|
||||
(1, '2021-03-01', '2021-03-02', '2021-03-03'),
|
||||
(1, '2021-02-01', '2021-02-02', '2021-02-03'),
|
||||
(1, '2021-01-01', '2021-01-02', '2021-01-03'),
|
||||
(null, '2021-05-01', 'null', '2021-04-03')
|
||||
"""
|
||||
|
||||
sql "set enable_vectorized_engine = true"
|
||||
(1, '2021-04-01', '2021-04-02', '2021-04-03', '2021-04-01', '2021-04-02', '2021-04-03'),
|
||||
(1, '2021-03-01', '2021-03-02', '2021-03-03', '2021-03-01', '2021-03-02', '2021-03-03'),
|
||||
(1, '2021-02-01', '2021-02-02', '2021-02-03', '2021-02-01', '2021-02-02', '2021-02-03'),
|
||||
(1, '2021-01-01', '2021-01-02', '2021-01-03', '2021-01-01', '2021-01-02', '2021-01-03'),
|
||||
(null, '2021-05-01', 'null', '2021-04-03', '2021-05-01', 'null', '2021-04-03')
|
||||
"""
|
||||
|
||||
qt_sql1 "select date1 from ${table1} order by date1"
|
||||
|
||||
@ -73,5 +74,28 @@ PROPERTIES (
|
||||
qt_select_is_null_pred "select date1 from ${table1} where date2 is null order by date1"
|
||||
qt_select_is_not_null_pred "select date1 from ${table1} where date2 is not null order by date1"
|
||||
|
||||
|
||||
qt_sql1 "select date4 from ${table1} order by date4"
|
||||
|
||||
// read single column
|
||||
qt_select_1_column "select date4 from ${table1} order by date4"
|
||||
|
||||
// date as pred
|
||||
qt_select_pred_1 "select date4 from ${table1} where date4='2021-03-01'"
|
||||
qt_select_pred_2 "select date4 from ${table1} where date4='2021-04-01'"
|
||||
qt_select_pred_3 "select date5,date4 from ${table1} where date4='2021-04-01'"
|
||||
|
||||
|
||||
// in pred
|
||||
qt_select_in_pred_1 "select date4 from ${table1} where date4 in ('2021-01-01')"
|
||||
qt_select_in_pred_1 "select * from ${table1} where date4 in ('2021-01-01')"
|
||||
|
||||
// not in pred
|
||||
qt_select_not_in_pred_1 "select date4 from ${table1} where date4 not in ('2021-01-01') order by date4"
|
||||
|
||||
// is null
|
||||
qt_select_is_null_pred "select date4 from ${table1} where date5 is null order by date4"
|
||||
qt_select_is_not_null_pred "select date4 from ${table1} where date5 is not null order by date4"
|
||||
|
||||
sql "drop table if exists ${table1}"
|
||||
}
|
||||
|
||||
@ -26,7 +26,10 @@ suite("test_dup_tab_datetime") {
|
||||
`siteid` int(11) NOT NULL COMMENT "",
|
||||
`datetime1` datetime NOT NULL COMMENT "",
|
||||
`datetime2` datetime NOT NULL COMMENT "",
|
||||
`datetime3` datetime NOT NULL COMMENT ""
|
||||
`datetime3` datetime NOT NULL COMMENT "",
|
||||
`datetime4` datetimev2 NOT NULL COMMENT "",
|
||||
`datetime5` datetimev2(3) NOT NULL COMMENT "",
|
||||
`datetime6` datetimev2(6) NOT NULL COMMENT ""
|
||||
) ENGINE=OLAP
|
||||
DUPLICATE KEY(`siteid`)
|
||||
COMMENT "OLAP"
|
||||
@ -39,11 +42,11 @@ PROPERTIES (
|
||||
"""
|
||||
|
||||
sql """insert into ${table1} values
|
||||
(1,'2021-01-01 23:10:01','2021-01-02 23:10:04','2021-01-02 22:10:04'),
|
||||
(2,'2021-02-01 23:10:01','2021-02-02 23:10:04','2021-03-02 22:10:04'),
|
||||
(3,'2021-03-01 23:10:01','2021-03-02 23:10:04','2021-04-02 22:10:04'),
|
||||
(4,'2021-04-01 23:10:01','2021-04-02 23:10:04','2021-05-02 22:10:04'),
|
||||
(5,'2021-05-01 23:10:01','2021-05-02 23:10:04','2021-06-02 22:10:04')
|
||||
(1,'2021-01-01 23:10:01','2021-01-02 23:10:04','2021-01-02 22:10:04','2021-01-01 23:10:01.111111','2021-01-02 23:10:04.111111','2021-01-02 22:10:04.111111'),
|
||||
(2,'2021-02-01 23:10:01','2021-02-02 23:10:04','2021-03-02 22:10:04','2021-01-01 23:10:01.111111','2021-01-02 23:10:04.111111','2021-01-02 22:10:04.111111'),
|
||||
(3,'2021-03-01 23:10:01','2021-03-02 23:10:04','2021-04-02 22:10:04','2021-01-01 23:10:01.111111','2021-01-02 23:10:04.111111','2021-01-02 22:10:04.111111'),
|
||||
(4,'2021-04-01 23:10:01','2021-04-02 23:10:04','2021-05-02 22:10:04','2021-01-01 23:10:01.111111','2021-01-02 23:10:04.111111','2021-01-02 22:10:04.111111'),
|
||||
(5,'2021-05-01 23:10:01','2021-05-02 23:10:04','2021-06-02 22:10:04','2021-01-01 23:10:01.111111','2021-01-02 23:10:04.111111','2021-01-02 22:10:04.111111')
|
||||
"""
|
||||
|
||||
qt_read_single_column_1 "select datetime1 from ${table1}"
|
||||
@ -53,6 +56,27 @@ PROPERTIES (
|
||||
|
||||
qt_read_multiple_column "select * from ${table1} where datetime3='2021-06-02 22:10:04'"
|
||||
|
||||
qt_read_single_column_1 "select datetime4 from ${table1}"
|
||||
|
||||
qt_datetime_as_pred "select * from ${table1} where datetime4='2021-01-01 23:10:01'"
|
||||
|
||||
qt_read_multiple_column "select * from ${table1} where datetime4='2021-01-01 23:10:01.11'"
|
||||
qt_read_multiple_column "select * from ${table1} where datetime4<'2021-01-01 23:10:01.11'"
|
||||
|
||||
qt_read_single_column_1 "select datetime5 from ${table1}"
|
||||
|
||||
qt_datetime_as_pred "select * from ${table1} where datetime5='2021-01-02 23:10:04'"
|
||||
|
||||
qt_read_multiple_column "select * from ${table1} where datetime5='2021-01-02 23:10:04.111'"
|
||||
qt_read_multiple_column "select * from ${table1} where datetime5<'2021-01-02 23:10:04.111111'"
|
||||
|
||||
qt_read_single_column_1 "select datetime6 from ${table1}"
|
||||
|
||||
qt_datetime_as_pred "select * from ${table1} where datetime6='2021-01-02 23:10:04'"
|
||||
|
||||
qt_read_multiple_column "select * from ${table1} where datetime6='2021-01-02 22:10:04.111111'"
|
||||
qt_read_multiple_column "select * from ${table1} where datetime6<'2021-01-02 22:10:04.111111'"
|
||||
|
||||
sql "drop table if exists ${table1}"
|
||||
|
||||
}
|
||||
@ -26,7 +26,10 @@ suite("test_dup_tab_datetime_nullable") {
|
||||
`siteid` int(11) NULL COMMENT "",
|
||||
`datetime1` datetime NULL COMMENT "",
|
||||
`datetime2` datetime NULL COMMENT "",
|
||||
`datetime3` datetime NULL COMMENT ""
|
||||
`datetime3` datetime NULL COMMENT "",
|
||||
`datetime4` datetimev2 NULL COMMENT "",
|
||||
`datetime5` datetimev2(3) NULL COMMENT "",
|
||||
`datetime6` datetimev2(6) NULL COMMENT ""
|
||||
) ENGINE=OLAP
|
||||
DUPLICATE KEY(`siteid`)
|
||||
COMMENT "OLAP"
|
||||
@ -39,18 +42,16 @@ PROPERTIES (
|
||||
|
||||
"""
|
||||
|
||||
sql "set enable_vectorized_engine = false"
|
||||
sql "set enable_vectorized_engine = true"
|
||||
|
||||
sql """insert into ${table1} values
|
||||
(1,'2021-01-01 23:10:01','2021-01-02 23:10:04','2021-01-02 22:10:04'),
|
||||
(2,'2021-02-01 23:10:01','2021-02-02 23:10:04','2021-03-02 22:10:04'),
|
||||
(3,'2021-03-01 23:10:01','2021-03-02 23:10:04','2021-04-02 22:10:04'),
|
||||
(4,'2021-04-01 23:10:01','2021-04-02 23:10:04','2021-05-02 22:10:04'),
|
||||
(5,'2021-05-01 23:10:01','2021-05-02 23:10:04','2021-06-02 22:10:04'),
|
||||
(null,'2021-06-01 23:10:01',null,'2021-06-02 22:10:04')
|
||||
"""
|
||||
|
||||
sql "set enable_vectorized_engine = true"
|
||||
(1,'2021-01-01 23:10:01','2021-01-02 23:10:04','2021-01-02 22:10:04','2021-01-01 23:10:01.111111','2021-01-02 23:10:04.111111','2021-01-02 22:10:04.111111'),
|
||||
(2,'2021-02-01 23:10:01','2021-02-02 23:10:04','2021-03-02 22:10:04','2021-02-01 23:10:01.111111','2021-02-02 23:10:04.111111','2021-03-02 22:10:04.111111'),
|
||||
(3,'2021-03-01 23:10:01','2021-03-02 23:10:04','2021-04-02 22:10:04','2021-03-01 23:10:01.111111','2021-03-02 23:10:04.111111','2021-04-02 22:10:04.111111'),
|
||||
(4,'2021-04-01 23:10:01','2021-04-02 23:10:04','2021-05-02 22:10:04','2021-04-01 23:10:01.111111','2021-04-02 23:10:04.111111','2021-05-02 22:10:04.111111'),
|
||||
(5,'2021-05-01 23:10:01','2021-05-02 23:10:04','2021-06-02 22:10:04','2021-05-01 23:10:01.111111','2021-05-02 23:10:04.111111','2021-06-02 22:10:04.111111'),
|
||||
(null,'2021-06-01 23:10:01',null,'2021-06-02 22:10:04','2021-06-01 23:10:01.111111',null,'2021-06-02 22:10:04.111111')
|
||||
"""
|
||||
|
||||
qt_read_single_column_1 "select datetime1 from ${table1}"
|
||||
qt_read_single_column_2 "select siteid from ${table1}"
|
||||
@ -66,6 +67,34 @@ PROPERTIES (
|
||||
qt_non_key_is_null "select * from ${table1} where datetime2 is null"
|
||||
qt_non_key_is_not_null "select * from ${table1} where datetime2 is not null"
|
||||
|
||||
qt_non_key_is_null "select * from ${table1} where datetime5 is null"
|
||||
qt_non_key_is_not_null "select * from ${table1} where datetime5 is not null"
|
||||
|
||||
qt_read_single_column_1 "select datetime4 from ${table1}"
|
||||
|
||||
qt_datetime_as_pred_1 "select datetime4 from ${table1} where datetime4='2021-05-01 23:10:01'"
|
||||
qt_datetime_as_pred_2 "select datetime4 from ${table1} where datetime4!='2021-05-01 23:10:01'"
|
||||
qt_datetime_as_pred_3 "select datetime4 from ${table1} where datetime4='2021-05-01 23:10:01.111111'"
|
||||
qt_datetime_as_pred_4 "select datetime4 from ${table1} where datetime4!='2021-05-01 23:10:01.111111'"
|
||||
qt_datetime_as_pred_5 "select datetime4 from ${table1} where datetime4 < '2021-05-01 23:10:01.111111'"
|
||||
qt_datetime_as_pred_6 "select datetime4 from ${table1} where datetime4 < '2021-05-01 23:10:01.011111'"
|
||||
|
||||
qt_read_single_column_1 "select datetime5 from ${table1}"
|
||||
|
||||
qt_datetime_as_pred_1 "select datetime5 from ${table1} where datetime5='2021-05-02 23:10:04.111'"
|
||||
qt_datetime_as_pred_2 "select datetime5 from ${table1} where datetime5!='2021-05-02 23:10:04.111'"
|
||||
qt_datetime_as_pred_3 "select datetime5 from ${table1} where datetime5='2021-05-02 23:10:04.111111'"
|
||||
qt_datetime_as_pred_4 "select datetime5 from ${table1} where datetime5!='2021-05-02 23:10:04.111111'"
|
||||
qt_datetime_as_pred_5 "select datetime5 from ${table1} where datetime5<'2021-05-02 23:10:04.111111'"
|
||||
qt_datetime_as_pred_6 "select datetime5 from ${table1} where datetime5<'2021-05-02 23:10:04.011111'"
|
||||
|
||||
qt_read_single_column_1 "select datetime6 from ${table1}"
|
||||
|
||||
qt_datetime_as_pred_1 "select datetime6 from ${table1} where datetime6='2021-05-02 22:10:04.111111'"
|
||||
qt_datetime_as_pred_2 "select datetime6 from ${table1} where datetime6!='2021-05-02 22:10:04.111111'"
|
||||
qt_datetime_as_pred_3 "select datetime6 from ${table1} where datetime6<'2021-05-02 22:10:04.111111'"
|
||||
qt_datetime_as_pred_4 "select datetime6 from ${table1} where datetime6<='2021-05-02 22:10:04.111111'"
|
||||
|
||||
sql "drop table if exists ${table1}"
|
||||
|
||||
}
|
||||
@ -31,14 +31,18 @@ suite("test_duplicate_table") {
|
||||
k int,
|
||||
int_value int,
|
||||
char_value char(10),
|
||||
date_value date
|
||||
date_value date,
|
||||
date_value2 datev2,
|
||||
date_value3 datetimev2,
|
||||
date_value4 datetimev2(3),
|
||||
date_value5 datetimev2(6)
|
||||
)
|
||||
DUPLICATE KEY(k)
|
||||
DISTRIBUTED BY HASH(k) BUCKETS 5 properties("replication_num" = "1")
|
||||
"""
|
||||
sql "insert into ${tbName} values(0, 1, 'test char', '2000-01-01')"
|
||||
sql "insert into ${tbName} values(0, 2, 'test int', '2000-02-02')"
|
||||
sql "insert into ${tbName} values(0, null, null, null)"
|
||||
sql "insert into ${tbName} values(0, 1, 'test char', '2000-01-01', '2000-01-01', '2000-01-01 11:00:11.111111', '2000-01-01 11:00:11.111111', '2000-01-01 11:00:11.111111')"
|
||||
sql "insert into ${tbName} values(0, 2, 'test int', '2000-02-02', '2000-02-02', '2000-02-02 11:00:11.111111', '2000-02-02 11:00:11.111111', '2000-02-02 11:00:11.111111')"
|
||||
sql "insert into ${tbName} values(0, null, null, null, null, null, null, null)"
|
||||
order_qt_select_dup_table "select * from ${tbName}"
|
||||
qt_desc_dup_table "desc ${tbName}"
|
||||
sql "DROP TABLE ${tbName}"
|
||||
|
||||
@ -23,16 +23,19 @@ suite("test_date_in_predicate") {
|
||||
CREATE TABLE IF NOT EXISTS ${tbName} (
|
||||
c0 int,
|
||||
c1 char(10),
|
||||
c2 date
|
||||
c2 date,
|
||||
c3 datev2
|
||||
)
|
||||
UNIQUE KEY(c0)
|
||||
DISTRIBUTED BY HASH(c0) BUCKETS 5 properties("replication_num" = "1");
|
||||
"""
|
||||
sql "insert into ${tbName} values(1, 'test1', '2000-01-01')"
|
||||
sql "insert into ${tbName} values(2, 'test2', '2000-02-02')"
|
||||
sql "insert into ${tbName} values(3, 'test3', '2000-03-02')"
|
||||
sql "insert into ${tbName} values(1, 'test1', '2000-01-01', '2000-01-01')"
|
||||
sql "insert into ${tbName} values(2, 'test2', '2000-02-02', '2000-02-02')"
|
||||
sql "insert into ${tbName} values(3, 'test3', '2000-03-02', '2000-03-02')"
|
||||
|
||||
qt_sql1 "select * from ${tbName} where c2 in ('2000-02-02')"
|
||||
qt_sql2 "select * from ${tbName} where c2 not in ('2000-02-02')"
|
||||
qt_sql3 "select * from ${tbName} where c3 in ('2000-02-02')"
|
||||
qt_sql4 "select * from ${tbName} where c3 not in ('2000-02-02')"
|
||||
sql "DROP TABLE ${tbName}"
|
||||
}
|
||||
|
||||
@ -31,4 +31,45 @@ suite("test_delete") {
|
||||
qt_sql """select count(c2) from ${tableName} where c1 = 'abcdef';"""
|
||||
qt_sql """select count(c1) from ${tableName};"""
|
||||
qt_sql """select count(c1) from ${tableName} where c1 = 'abcdef';"""
|
||||
|
||||
sql """ DROP TABLE IF EXISTS ${tableName} """
|
||||
|
||||
sql """ CREATE TABLE delete_regression_test (k1 varchar(190) NOT NULL COMMENT "", k2 DATEV2 NOT NULL COMMENT "", k3 DATETIMEV2 NOT NULL COMMENT "", k4 DATETIMEV2(3) NOT NULL COMMENT "", v1 DATEV2 NOT NULL COMMENT "", v2 DATETIMEV2 NOT NULL COMMENT "", v3 DATETIMEV2(3) NOT NULL COMMENT "" ) ENGINE=OLAP DUPLICATE KEY(k1, k2, k3, k4) COMMENT "OLAP" DISTRIBUTED BY HASH(k1, k2, k3, k4) BUCKETS 3
|
||||
PROPERTIES ( "replication_num" = "1" );"""
|
||||
|
||||
sql """ INSERT INTO delete_regression_test VALUES ('abcdef','2022-08-16','2022-08-16 11:11:11.111111','2022-08-16 11:11:11.111111','2022-08-16','2022-08-16 11:11:11.111111','2022-08-16 11:11:11.111111'),('abcdef','2022-08-12','2022-08-16 12:11:11.111111','2022-08-16 12:11:11.111111','2022-08-12','2022-08-16 12:11:11.111111','2022-08-16 12:11:11.111111'); """
|
||||
sql """ delete from ${tableName} where k2 = '2022-08-16' """
|
||||
qt_sql """select * from ${tableName};"""
|
||||
sql """ delete from delete_regression_test where k1 = 'abcdef' """
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES ('abcdef','2022-08-16','2022-08-16 11:11:11.111111','2022-08-16 11:11:11.111111','2022-08-16','2022-08-16 11:11:11.111111','2022-08-16 11:11:11.111111'),('abcdef','2022-08-12','2022-08-16 12:11:11.111111','2022-08-16 12:11:11.111111','2022-08-12','2022-08-16 12:11:11.111111','2022-08-16 12:11:11.111111'); """
|
||||
sql """ delete from delete_regression_test where k3 = '2022-08-16 11:11:11' """
|
||||
qt_sql """select * from ${tableName};"""
|
||||
sql """ delete from delete_regression_test where k1 = 'abcdef' """
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES ('abcdef','2022-08-16','2022-08-16 11:11:11.111111','2022-08-16 11:11:11.111111','2022-08-16','2022-08-16 11:11:11.111111','2022-08-16 11:11:11.111111'),('abcdef','2022-08-12','2022-08-16 12:11:11.111111','2022-08-16 12:11:11.111111','2022-08-12','2022-08-16 12:11:11.111111','2022-08-16 12:11:11.111111'); """
|
||||
sql """ delete from ${tableName} where k4 = '2022-08-16 11:11:11' """
|
||||
qt_sql """select * from ${tableName};"""
|
||||
sql """ delete from ${tableName} where k4 = '2022-08-16 11:11:11.111' """
|
||||
qt_sql """select * from ${tableName};"""
|
||||
sql """ delete from delete_regression_test where k1 = 'abcdef' """
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES ('abcdef','2022-08-16','2022-08-16 11:11:11.111111','2022-08-16 11:11:11.111111','2022-08-16','2022-08-16 11:11:11.111111','2022-08-16 11:11:11.111111'),('abcdef','2022-08-12','2022-08-16 12:11:11.111111','2022-08-16 12:11:11.111111','2022-08-12','2022-08-16 12:11:11.111111','2022-08-16 12:11:11.111111'); """
|
||||
sql """ delete from ${tableName} where v1 = '2022-08-16' """
|
||||
qt_sql """select * from ${tableName};"""
|
||||
sql """ delete from delete_regression_test where k1 = 'abcdef' """
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES ('abcdef','2022-08-16','2022-08-16 11:11:11.111111','2022-08-16 11:11:11.111111','2022-08-16','2022-08-16 11:11:11.111111','2022-08-16 11:11:11.111111'),('abcdef','2022-08-12','2022-08-16 12:11:11.111111','2022-08-16 12:11:11.111111','2022-08-12','2022-08-16 12:11:11.111111','2022-08-16 12:11:11.111111'); """
|
||||
sql """ delete from ${tableName} where v2 = '2022-08-16 11:11:11' """
|
||||
qt_sql """select * from ${tableName};"""
|
||||
sql """ delete from delete_regression_test where k1 = 'abcdef' """
|
||||
|
||||
sql """ INSERT INTO ${tableName} VALUES ('abcdef','2022-08-16','2022-08-16 11:11:11.111111','2022-08-16 11:11:11.111111','2022-08-16','2022-08-16 11:11:11.111111','2022-08-16 11:11:11.111111'),('abcdef','2022-08-12','2022-08-16 12:11:11.111111','2022-08-16 12:11:11.111111','2022-08-12','2022-08-16 12:11:11.111111','2022-08-16 12:11:11.111111'); """
|
||||
sql """ delete from ${tableName} where v3 = '2022-08-16 11:11:11' """
|
||||
qt_sql """select * from ${tableName};"""
|
||||
sql """ delete from ${tableName} where v3 = '2022-08-16 11:11:11.111' """
|
||||
qt_sql """select * from ${tableName};"""
|
||||
sql """ delete from delete_regression_test where k1 = 'abcdef' """
|
||||
|
||||
sql """ DROP TABLE IF EXISTS ${tableName} """
|
||||
}
|
||||
|
||||
@ -57,6 +57,10 @@ suite("test_outfile") {
|
||||
`user_id` LARGEINT NOT NULL COMMENT "用户id",
|
||||
`date` DATE NOT NULL COMMENT "数据灌入日期时间",
|
||||
`datetime` DATETIME NOT NULL COMMENT "数据灌入日期时间",
|
||||
`date_1` DATEV2 NOT NULL COMMENT "",
|
||||
`datetime_1` DATETIMEV2 NOT NULL COMMENT "",
|
||||
`datetime_2` DATETIMEV2(3) NOT NULL COMMENT "",
|
||||
`datetime_3` DATETIMEV2(6) NOT NULL COMMENT "",
|
||||
`city` VARCHAR(20) COMMENT "用户所在城市",
|
||||
`age` SMALLINT COMMENT "用户年龄",
|
||||
`sex` TINYINT COMMENT "用户性别",
|
||||
@ -75,11 +79,11 @@ suite("test_outfile") {
|
||||
int i = 1
|
||||
for (; i < 1000; i ++) {
|
||||
sb.append("""
|
||||
(${i}, '2017-10-01', '2017-10-01 00:00:00', 'Beijing', ${i}, ${i % 128}, true, ${i}, ${i}, ${i}, ${i}.${i}, ${i}.${i}, 'char${i}', ${i}),
|
||||
(${i}, '2017-10-01', '2017-10-01 00:00:00', '2017-10-01', '2017-10-01 00:00:00.111111', '2017-10-01 00:00:00.111111', '2017-10-01 00:00:00.111111', 'Beijing', ${i}, ${i % 128}, true, ${i}, ${i}, ${i}, ${i}.${i}, ${i}.${i}, 'char${i}', ${i}),
|
||||
""")
|
||||
}
|
||||
sb.append("""
|
||||
(${i}, '2017-10-01', '2017-10-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
|
||||
(${i}, '2017-10-01', '2017-10-01 00:00:00', '2017-10-01', '2017-10-01 00:00:00.111111', '2017-10-01 00:00:00.111111', '2017-10-01 00:00:00.111111', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
|
||||
""")
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
${sb.toString()}
|
||||
|
||||
@ -58,4 +58,47 @@ suite("test_dynamic_partition") {
|
||||
// check exception message contains
|
||||
exception "errCode = 2,"
|
||||
}
|
||||
sql "drop table if exists dy_par_bad"
|
||||
|
||||
sql """
|
||||
CREATE TABLE dy_par ( k1 datev2 NOT NULL, k2 varchar(20) NOT NULL, k3 int sum NOT NULL )
|
||||
AGGREGATE KEY(k1,k2)
|
||||
PARTITION BY RANGE(k1) ( )
|
||||
DISTRIBUTED BY HASH(k1) BUCKETS 3
|
||||
PROPERTIES (
|
||||
"dynamic_partition.enable"="true",
|
||||
"dynamic_partition.end"="3",
|
||||
"dynamic_partition.buckets"="10",
|
||||
"dynamic_partition.start"="-3",
|
||||
"dynamic_partition.prefix"="p",
|
||||
"dynamic_partition.time_unit"="DAY",
|
||||
"dynamic_partition.create_history_partition"="true",
|
||||
"dynamic_partition.replication_allocation" = "tag.location.default: 1")
|
||||
"""
|
||||
result = sql "show tables like 'dy_par'"
|
||||
logger.info("${result}")
|
||||
assertEquals(result.size(), 1)
|
||||
sql "drop table dy_par"
|
||||
//
|
||||
sql "drop table if exists dy_par_bad"
|
||||
test {
|
||||
sql """
|
||||
CREATE TABLE dy_par_bad ( k1 datev2 NOT NULL, k2 varchar(20) NOT NULL, k3 int sum NOT NULL )
|
||||
AGGREGATE KEY(k1,k2)
|
||||
PARTITION BY RANGE(k1) ( )
|
||||
DISTRIBUTED BY HASH(k1) BUCKETS 3
|
||||
PROPERTIES (
|
||||
"dynamic_partition.enable"="true",
|
||||
"dynamic_partition.end"="3",
|
||||
"dynamic_partition.buckets"="10",
|
||||
"dynamic_partition.start"="-3",
|
||||
"dynamic_partition.prefix"="p",
|
||||
"dynamic_partition.time_unit"="DAY",
|
||||
"dynamic_partition.create_history_partition"="true",
|
||||
"dynamic_partition.replication_allocation" = "tag.location.not_exist_tag: 1")
|
||||
"""
|
||||
// check exception message contains
|
||||
exception "errCode = 2,"
|
||||
}
|
||||
sql "drop table if exists dy_par_bad"
|
||||
}
|
||||
|
||||
@ -27,11 +27,15 @@ suite("test_list_partition") {
|
||||
k5 decimal(9, 3) NOT NULL,
|
||||
k6 char(5) NOT NULL,
|
||||
k10 date NOT NULL,
|
||||
k11 datetime NOT NULL,
|
||||
k11 datetime NOT NULL,
|
||||
k12 datev2 NOT NULL,
|
||||
k13 datetimev2 NOT NULL,
|
||||
k14 datetimev2(3) NOT NULL,
|
||||
k15 datetimev2(6) NOT NULL,
|
||||
k7 varchar(20) NOT NULL,
|
||||
k8 double max NOT NULL,
|
||||
k9 float sum NOT NULL )
|
||||
AGGREGATE KEY(k1,k2,k3,k4,k5,k6,k10,k11,k7)
|
||||
AGGREGATE KEY(k1,k2,k3,k4,k5,k6,k10,k11,k12,k13,k14,k15,k7)
|
||||
PARTITION BY LIST(k1) (
|
||||
PARTITION p1 VALUES IN ("1","2","3","4"),
|
||||
PARTITION p2 VALUES IN ("5","6","7","8","9","10","11","12","13","14"),
|
||||
|
||||
@ -33,6 +33,12 @@ suite("aggregate_count1", "query") {
|
||||
"\n" +
|
||||
" birthday DATETIME ,\n" +
|
||||
"\n" +
|
||||
" birthday1 DATETIMEV2 ,\n" +
|
||||
"\n" +
|
||||
" birthday2 DATETIMEV2(3) ,\n" +
|
||||
"\n" +
|
||||
" birthday3 DATETIMEV2(6) ,\n" +
|
||||
"\n" +
|
||||
" country String ,\n" +
|
||||
"\n" +
|
||||
" gender String ,\n" +
|
||||
@ -45,14 +51,14 @@ suite("aggregate_count1", "query") {
|
||||
"\n" +
|
||||
"PROPERTIES(\"replication_num\" = \"1\");\n" +
|
||||
"\n"
|
||||
sql "insert into aggregate_count1 values ('张三0',11,'1234567','123','321312','1999-02-13','中国','男',false)," +
|
||||
"('张三1',11,'12345678','123','321312','1999-02-13','中国','男',false)," +
|
||||
"('张三2',11,'12345671','123','321312','1999-02-13','中国','男',false)," +
|
||||
"('张三3',11,'12345673','123','321312','1999-02-13','中国','男',false)," +
|
||||
"('张三4',11,'123456711','123','321312','1999-02-13','中国','男',false)," +
|
||||
"('张三5',11,'1232134567','123','321312','1999-02-13','中国','男',false)," +
|
||||
"('张三6',11,'124314567','123','321312','1999-02-13','中国','男',false)," +
|
||||
"('张三7',11,'123445167','123','321312','1998-02-13','中国','男',false);"
|
||||
sql "insert into aggregate_count1 values ('张三0',11,'1234567','123','321312','1999-02-13','1999-02-13','1999-02-13','1999-02-13','中国','男',false)," +
|
||||
"('张三1',11,'12345678','123','321312','1999-02-13','1999-02-13','1999-02-13','1999-02-13','中国','男',false)," +
|
||||
"('张三2',11,'12345671','123','321312','1999-02-13','1999-02-13','1999-02-13','1999-02-13','中国','男',false)," +
|
||||
"('张三3',11,'12345673','123','321312','1999-02-13','1999-02-13','1999-02-13','1999-02-13','中国','男',false)," +
|
||||
"('张三4',11,'123456711','123','321312','1999-02-13','1999-02-13','1999-02-13','1999-02-13','中国','男',false)," +
|
||||
"('张三5',11,'1232134567','123','321312','1999-02-13','1999-02-13','1999-02-13','1999-02-13','中国','男',false)," +
|
||||
"('张三6',11,'124314567','123','321312','1999-02-13','1999-02-13','1999-02-13','1999-02-13','中国','男',false)," +
|
||||
"('张三7',11,'123445167','123','321312','1998-02-13','1999-02-13','1999-02-13','1999-02-13','中国','男',false);"
|
||||
qt_select "SELECT count(1) FROM (WITH t1 AS (\n" +
|
||||
" WITH t AS (\n" +
|
||||
" SELECT * FROM aggregate_count1\n" +
|
||||
|
||||
@ -30,6 +30,10 @@ suite("aggregate") {
|
||||
c_string string,
|
||||
c_date date,
|
||||
c_timestamp datetime,
|
||||
c_date_1 datev2,
|
||||
c_timestamp_1 datetimev2,
|
||||
c_timestamp_2 datetimev2(3),
|
||||
c_timestamp_3 datetimev2(6),
|
||||
c_boolean boolean,
|
||||
c_short_decimal decimal(5,2),
|
||||
c_long_decimal decimal(27,9)
|
||||
@ -82,6 +86,10 @@ suite("aggregate") {
|
||||
qt_aggregate """ select count(distinct c_bigint),count(distinct c_double),count(distinct c_string),count(distinct c_date),count(distinct c_timestamp),count(distinct c_boolean) from ${tableName} """
|
||||
qt_aggregate """ select max(c_bigint), max(c_double),max(c_string), max(c_date), max(c_timestamp) from ${tableName} """
|
||||
qt_aggregate """ select min(c_bigint), min(c_double), min(c_string), min(c_date), min(c_timestamp) from ${tableName} """
|
||||
qt_aggregate """ select count(c_bigint),count(c_double),count(c_string),count(c_date_1),count(c_timestamp_1),count(c_timestamp_2),count(c_timestamp_3),count(c_boolean) from ${tableName} """
|
||||
qt_aggregate """ select count(distinct c_bigint),count(distinct c_double),count(distinct c_string),count(distinct c_date_1),count(distinct c_timestamp_1),count(distinct c_timestamp_2),count(distinct c_timestamp_3),count(distinct c_boolean) from ${tableName} """
|
||||
qt_aggregate """ select max(c_bigint), max(c_double),max(c_string), max(c_date_1), max(c_timestamp_1), max(c_timestamp_2), max(c_timestamp_3) from ${tableName} """
|
||||
qt_aggregate """ select min(c_bigint), min(c_double), min(c_string), min(c_date_1), min(c_timestamp_1), min(c_timestamp_2), min(c_timestamp_3) from ${tableName} """
|
||||
qt_aggregate """ select count(c_string), max(c_double), avg(c_bigint) from ${tableName} """
|
||||
qt_aggregate """ select stddev_pop(c_bigint), stddev_pop(c_double) from ${tableName} """
|
||||
qt_aggregate """ select stddev_pop(distinct c_bigint), stddev_pop(c_double) from ${tableName} """
|
||||
|
||||
@ -60,4 +60,46 @@ suite("window_funnel") {
|
||||
) AS level
|
||||
from ${tableName} t;
|
||||
"""
|
||||
|
||||
sql """ DROP TABLE IF EXISTS ${tableName} """
|
||||
sql """
|
||||
CREATE TABLE IF NOT EXISTS ${tableName} (
|
||||
xwho varchar(50) NULL COMMENT 'xwho',
|
||||
xwhen datetimev2(3) COMMENT 'xwhen',
|
||||
xwhat int NULL COMMENT 'xwhat'
|
||||
)
|
||||
DUPLICATE KEY(xwho)
|
||||
DISTRIBUTED BY HASH(xwho) BUCKETS 3
|
||||
PROPERTIES (
|
||||
"replication_num" = "1"
|
||||
);
|
||||
"""
|
||||
sql "INSERT into ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12 10:41:00.111111', 1)"
|
||||
sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12 13:28:02.111111', 2)"
|
||||
sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12 16:15:01.111111', 3)"
|
||||
sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12 19:05:04.111111', 4)"
|
||||
|
||||
qt_window_funnel """
|
||||
select
|
||||
window_funnel(
|
||||
1,
|
||||
'default',
|
||||
t.xwhen,
|
||||
t.xwhat = 1,
|
||||
t.xwhat = 2
|
||||
) AS level
|
||||
from ${tableName} t;
|
||||
"""
|
||||
qt_window_funnel """
|
||||
select
|
||||
window_funnel(
|
||||
20000,
|
||||
'default',
|
||||
t.xwhen,
|
||||
t.xwhat = 1,
|
||||
t.xwhat = 2
|
||||
) AS level
|
||||
from ${tableName} t;
|
||||
"""
|
||||
sql """ DROP TABLE IF EXISTS ${tableName} """
|
||||
}
|
||||
|
||||
@ -77,4 +77,228 @@ suite("partition_cache") {
|
||||
k1;
|
||||
"""
|
||||
sql " set enable_partition_cache=false "
|
||||
|
||||
sql """ DROP TABLE IF EXISTS ${tableName} """
|
||||
sql """
|
||||
CREATE TABLE IF NOT EXISTS ${tableName} (
|
||||
`k1` datev2 NOT NULL COMMENT "",
|
||||
`k2` int(11) NOT NULL COMMENT ""
|
||||
) ENGINE=OLAP
|
||||
DUPLICATE KEY(`k1`, `k2`)
|
||||
COMMENT "OLAP"
|
||||
PARTITION BY RANGE(`k1`)
|
||||
(PARTITION p202205 VALUES [('2022-05-01'), ('2022-06-01')),
|
||||
PARTITION p202206 VALUES [('2022-06-01'), ('2022-07-01')))
|
||||
DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32
|
||||
PROPERTIES (
|
||||
"replication_allocation" = "tag.location.default: 1",
|
||||
"in_memory" = "false",
|
||||
"storage_format" = "V2"
|
||||
)
|
||||
"""
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
("2022-05-27",0),
|
||||
("2022-05-28",0),
|
||||
("2022-05-29",0),
|
||||
("2022-05-30",0),
|
||||
("2022-06-01",0),
|
||||
("2022-06-02",0)
|
||||
"""
|
||||
sql " set enable_partition_cache=true "
|
||||
|
||||
qt_partition_cache """
|
||||
select
|
||||
k1,
|
||||
sum(k2) as total_pv
|
||||
from
|
||||
${tableName}
|
||||
where
|
||||
k1 between '2022-05-28' and '2022-06-30'
|
||||
group by
|
||||
k1
|
||||
order by
|
||||
k1;
|
||||
"""
|
||||
qt_partition_cache """
|
||||
select
|
||||
k1,
|
||||
sum(k2) as total_pv
|
||||
from
|
||||
${tableName}
|
||||
where
|
||||
k1 between '2022-05-28' and '2022-06-30'
|
||||
group by
|
||||
k1
|
||||
order by
|
||||
k1;
|
||||
"""
|
||||
sql " set enable_partition_cache=false "
|
||||
|
||||
sql """ DROP TABLE IF EXISTS ${tableName} """
|
||||
sql """
|
||||
CREATE TABLE IF NOT EXISTS ${tableName} (
|
||||
`k1` datetimev2(3) NOT NULL COMMENT "",
|
||||
`k2` int(11) NOT NULL COMMENT ""
|
||||
) ENGINE=OLAP
|
||||
DUPLICATE KEY(`k1`, `k2`)
|
||||
COMMENT "OLAP"
|
||||
PARTITION BY RANGE(`k1`)
|
||||
(PARTITION p202205 VALUES [('2022-05-01 11:11:11.111'), ('2022-06-01 11:11:11.111')),
|
||||
PARTITION p202206 VALUES [('2022-06-01 11:11:11.111'), ('2022-07-01 11:11:11.111')))
|
||||
DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32
|
||||
PROPERTIES (
|
||||
"replication_allocation" = "tag.location.default: 1",
|
||||
"in_memory" = "false",
|
||||
"storage_format" = "V2"
|
||||
)
|
||||
"""
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
("2022-05-27 11:11:11.111",0),
|
||||
("2022-05-28 11:11:11.111",0),
|
||||
("2022-05-29 11:11:11.111",0),
|
||||
("2022-05-30 11:11:11.111",0),
|
||||
("2022-06-01 11:11:11.111",0),
|
||||
("2022-06-02 11:11:11.111",0)
|
||||
"""
|
||||
sql " set enable_partition_cache=true "
|
||||
|
||||
qt_partition_cache """
|
||||
select
|
||||
k1,
|
||||
sum(k2) as total_pv
|
||||
from
|
||||
${tableName}
|
||||
where
|
||||
k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111'
|
||||
group by
|
||||
k1
|
||||
order by
|
||||
k1;
|
||||
"""
|
||||
qt_partition_cache """
|
||||
select
|
||||
k1,
|
||||
sum(k2) as total_pv
|
||||
from
|
||||
${tableName}
|
||||
where
|
||||
k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111'
|
||||
group by
|
||||
k1
|
||||
order by
|
||||
k1;
|
||||
"""
|
||||
sql " set enable_partition_cache=false "
|
||||
|
||||
sql """ DROP TABLE IF EXISTS ${tableName} """
|
||||
sql """
|
||||
CREATE TABLE IF NOT EXISTS ${tableName} (
|
||||
`k1` datetimev2(3) NOT NULL COMMENT "",
|
||||
`k2` int(11) NOT NULL COMMENT ""
|
||||
) ENGINE=OLAP
|
||||
DUPLICATE KEY(`k1`, `k2`)
|
||||
COMMENT "OLAP"
|
||||
PARTITION BY RANGE(`k1`)
|
||||
(PARTITION p202205 VALUES [('2022-05-01 11:11:11.111111'), ('2022-06-01 11:11:11.111111')),
|
||||
PARTITION p202206 VALUES [('2022-06-01 11:11:11.111111'), ('2022-07-01 11:11:11.111111')))
|
||||
DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32
|
||||
PROPERTIES (
|
||||
"replication_allocation" = "tag.location.default: 1",
|
||||
"in_memory" = "false",
|
||||
"storage_format" = "V2"
|
||||
)
|
||||
"""
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
("2022-05-27 11:11:11.111",0),
|
||||
("2022-05-28 11:11:11.111",0),
|
||||
("2022-05-29 11:11:11.111",0),
|
||||
("2022-05-30 11:11:11.111",0),
|
||||
("2022-06-01 11:11:11.111",0),
|
||||
("2022-06-02 11:11:11.111",0)
|
||||
"""
|
||||
sql " set enable_partition_cache=true "
|
||||
|
||||
qt_partition_cache """
|
||||
select
|
||||
k1,
|
||||
sum(k2) as total_pv
|
||||
from
|
||||
${tableName}
|
||||
where
|
||||
k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111'
|
||||
group by
|
||||
k1
|
||||
order by
|
||||
k1;
|
||||
"""
|
||||
qt_partition_cache """
|
||||
select
|
||||
k1,
|
||||
sum(k2) as total_pv
|
||||
from
|
||||
${tableName}
|
||||
where
|
||||
k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111'
|
||||
group by
|
||||
k1
|
||||
order by
|
||||
k1;
|
||||
"""
|
||||
sql " set enable_partition_cache=false "
|
||||
|
||||
sql """ DROP TABLE IF EXISTS ${tableName} """
|
||||
sql """
|
||||
CREATE TABLE IF NOT EXISTS ${tableName} (
|
||||
`k1` datetimev2(6) NOT NULL COMMENT "",
|
||||
`k2` int(11) NOT NULL COMMENT ""
|
||||
) ENGINE=OLAP
|
||||
DUPLICATE KEY(`k1`, `k2`)
|
||||
COMMENT "OLAP"
|
||||
PARTITION BY RANGE(`k1`)
|
||||
(PARTITION p202205 VALUES [('2022-05-01 11:11:11.111'), ('2022-06-01 11:11:11.111')),
|
||||
PARTITION p202206 VALUES [('2022-06-01 11:11:11.111'), ('2022-07-01 11:11:11.111')))
|
||||
DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32
|
||||
PROPERTIES (
|
||||
"replication_allocation" = "tag.location.default: 1",
|
||||
"in_memory" = "false",
|
||||
"storage_format" = "V2"
|
||||
)
|
||||
"""
|
||||
sql """ INSERT INTO ${tableName} VALUES
|
||||
("2022-05-27 11:11:11.111111",0),
|
||||
("2022-05-28 11:11:11.111111",0),
|
||||
("2022-05-29 11:11:11.111111",0),
|
||||
("2022-05-30 11:11:11.111111",0),
|
||||
("2022-06-01 11:11:11.111111",0),
|
||||
("2022-06-02 11:11:11.111111",0)
|
||||
"""
|
||||
sql " set enable_partition_cache=true "
|
||||
|
||||
qt_partition_cache """
|
||||
select
|
||||
k1,
|
||||
sum(k2) as total_pv
|
||||
from
|
||||
${tableName}
|
||||
where
|
||||
k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111'
|
||||
group by
|
||||
k1
|
||||
order by
|
||||
k1;
|
||||
"""
|
||||
qt_partition_cache """
|
||||
select
|
||||
k1,
|
||||
sum(k2) as total_pv
|
||||
from
|
||||
${tableName}
|
||||
where
|
||||
k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111'
|
||||
group by
|
||||
k1
|
||||
order by
|
||||
k1;
|
||||
"""
|
||||
sql " set enable_partition_cache=false "
|
||||
}
|
||||
|
||||
@ -26,6 +26,10 @@ suite("test_nullif") {
|
||||
c_string string,
|
||||
c_date date,
|
||||
c_timestamp datetime,
|
||||
c_date_1 datev2,
|
||||
c_timestamp_1 datetimev2,
|
||||
c_timestamp_2 datetimev2(3),
|
||||
c_timestamp_3 datetimev2(6),
|
||||
c_boolean boolean,
|
||||
c_short_decimal decimal(5,2),
|
||||
c_long_decimal decimal(27,9)
|
||||
@ -72,7 +76,10 @@ suite("test_nullif") {
|
||||
}
|
||||
|
||||
qt_select "select nullif(k6, \"false\") k from test_query_db.test order by k1"
|
||||
qt_select "select if(c_date is null,c_timestamp,c_date) from datetype where c_date is null and c_timestamp is not null"
|
||||
qt_select "select if(c_date is null,c_timestamp,c_date) from ${tableName} where c_date is null and c_timestamp is not null"
|
||||
qt_select "select if(c_date_1 is null,c_timestamp_1,c_date_1) from ${tableName} where c_date_1 is null and c_timestamp_1 is not null"
|
||||
qt_select "select if(c_date_1 is null,c_timestamp_2,c_date_1) from ${tableName} where c_date_1 is null and c_timestamp_2 is not null"
|
||||
qt_select "select if(c_date_1 is null,c_timestamp_3,c_date_1) from ${tableName} where c_date_1 is null and c_timestamp_3 is not null"
|
||||
|
||||
sql "use test_query_db"
|
||||
def tableName1 = "test"
|
||||
|
||||
@ -28,11 +28,15 @@ suite("test_select_stddev_variance_window") {
|
||||
`k6` char(5) NULL COMMENT "",
|
||||
`k10` date NULL COMMENT "",
|
||||
`k11` datetime NULL COMMENT "",
|
||||
`k12` datev2 NULL COMMENT "",
|
||||
`k13` datetimev2 NULL COMMENT "",
|
||||
`k14` datetimev2(3) NULL COMMENT "",
|
||||
`k15` datetimev2(6) NULL COMMENT "",
|
||||
`k7` varchar(20) NULL COMMENT "",
|
||||
`k8` double NULL COMMENT "",
|
||||
`k9` float NULL COMMENT ""
|
||||
) ENGINE=OLAP
|
||||
DUPLICATE KEY(`k1`, `k2`, `k3`, `k4`, `k5`, `k6`, `k10`, `k11`, `k7`)
|
||||
DUPLICATE KEY(`k1`, `k2`, `k3`, `k4`, `k5`, `k6`, `k10`, `k11`, `k12`, `k13`, `k14`, `k15`, `k7`)
|
||||
COMMENT "OLAP"
|
||||
DISTRIBUTED BY HASH(`k1`) BUCKETS 5
|
||||
PROPERTIES (
|
||||
|
||||
@ -20,9 +20,9 @@ suite("test_window_function") {
|
||||
|
||||
def windowFunctionTable1 = "test_window_function1"
|
||||
sql """ DROP TABLE IF EXISTS ${windowFunctionTable1} """
|
||||
sql """ create table ${windowFunctionTable1} (stock_symbol varchar(64), closing_price decimal(8,2), closing_date datetime not null) duplicate key (stock_symbol) distributed by hash (stock_symbol) PROPERTIES("replication_num" = "1") """
|
||||
sql """ create table ${windowFunctionTable1} (stock_symbol varchar(64), closing_price decimal(8,2), closing_date datetime not null, closing_date1 datetimev2 not null, closing_date2 datetimev2(3) not null, closing_date3 datetimev2(6) not null) duplicate key (stock_symbol) distributed by hash (stock_symbol) PROPERTIES("replication_num" = "1") """
|
||||
|
||||
sql """ INSERT INTO ${windowFunctionTable1} VALUES ('JDR',12.86,'2014-10-02 00:00:00'),('JDR',12.89,'2014-10-03 00:00:00'),('JDR',12.94,'2014-10-04 00:00:00'),('JDR',12.55,'2014-10-05 00:00:00'),('JDR',14.03,'2014-10-06 00:00:00'),('JDR',14.75,'2014-10-07 00:00:00'),('JDR',13.98,'2014-10-08 00:00:00') """
|
||||
sql """ INSERT INTO ${windowFunctionTable1} VALUES ('JDR',12.86,'2014-10-02 00:00:00','2014-10-02 00:00:00.111111','2014-10-02 00:00:00.111111','2014-10-02 00:00:00.111111'),('JDR',12.89,'2014-10-03 00:00:00','2014-10-03 00:00:00.111111','2014-10-03 00:00:00.111111','2014-10-03 00:00:00.111111'),('JDR',12.94,'2014-10-04 00:00:00','2014-10-04 00:00:00.111111','2014-10-04 00:00:00.111111','2014-10-04 00:00:00.111111'),('JDR',12.55,'2014-10-05 00:00:00','2014-10-05 00:00:00.111111','2014-10-05 00:00:00.111111','2014-10-05 00:00:00.111111'),('JDR',14.03,'2014-10-06 00:00:00','2014-10-06 00:00:00.111111','2014-10-06 00:00:00.111111','2014-10-06 00:00:00.111111'),('JDR',14.75,'2014-10-07 00:00:00','2014-10-07 00:00:00.111111','2014-10-07 00:00:00.111111','2014-10-07 00:00:00.111111'),('JDR',13.98,'2014-10-08 00:00:00','2014-10-08 00:00:00.111111','2014-10-08 00:00:00.111111','2014-10-08 00:00:00.111111') """
|
||||
|
||||
qt_sql """
|
||||
SELECT
|
||||
@ -69,6 +69,144 @@ suite("test_window_function") {
|
||||
ORDER BY
|
||||
closing_date;
|
||||
"""
|
||||
|
||||
qt_sql """
|
||||
SELECT
|
||||
stock_symbol,
|
||||
closing_date1,
|
||||
closing_price,
|
||||
avg( closing_price ) over ( PARTITION BY stock_symbol ORDER BY closing_date1 rows BETWEEN 1 preceding AND 1 following ) AS moving_average
|
||||
FROM
|
||||
${windowFunctionTable1}
|
||||
ORDER BY
|
||||
stock_symbol,
|
||||
closing_date1,
|
||||
closing_price
|
||||
"""
|
||||
// LEAD
|
||||
qt_sql """
|
||||
SELECT
|
||||
stock_symbol,
|
||||
closing_date1,
|
||||
closing_price,
|
||||
CASE ( lead( closing_price, 1, 0 ) over ( PARTITION BY stock_symbol ORDER BY closing_date1 )- closing_price ) > 0
|
||||
WHEN TRUE THEN "higher"
|
||||
WHEN FALSE THEN "flat or lower" END AS "trending"
|
||||
FROM
|
||||
${windowFunctionTable1}
|
||||
ORDER BY
|
||||
closing_date1;
|
||||
"""
|
||||
|
||||
// LEAD not nullable coredump
|
||||
qt_sql """
|
||||
select t1.new_time from (select closing_date1, lead(closing_date1, 1, '2014-10-02 00:00:00') over () as new_time from ${windowFunctionTable1}) as t1 left join ${windowFunctionTable1} t2 on t2.closing_date1 = t1.closing_date1 order by t1.new_time desc;
|
||||
"""
|
||||
|
||||
// LAG
|
||||
qt_sql """
|
||||
SELECT
|
||||
stock_symbol,
|
||||
closing_date1,
|
||||
closing_price,
|
||||
lag( closing_price, 1, 0 ) over ( PARTITION BY stock_symbol ORDER BY closing_date1 ) AS "yesterday closing"
|
||||
FROM
|
||||
${windowFunctionTable1}
|
||||
ORDER BY
|
||||
closing_date1;
|
||||
"""
|
||||
|
||||
qt_sql """
|
||||
SELECT
|
||||
stock_symbol,
|
||||
closing_date2,
|
||||
closing_price,
|
||||
avg( closing_price ) over ( PARTITION BY stock_symbol ORDER BY closing_date2 rows BETWEEN 1 preceding AND 1 following ) AS moving_average
|
||||
FROM
|
||||
${windowFunctionTable1}
|
||||
ORDER BY
|
||||
stock_symbol,
|
||||
closing_date2,
|
||||
closing_price
|
||||
"""
|
||||
// LEAD
|
||||
qt_sql """
|
||||
SELECT
|
||||
stock_symbol,
|
||||
closing_date2,
|
||||
closing_price,
|
||||
CASE ( lead( closing_price, 1, 0 ) over ( PARTITION BY stock_symbol ORDER BY closing_date2 )- closing_price ) > 0
|
||||
WHEN TRUE THEN "higher"
|
||||
WHEN FALSE THEN "flat or lower" END AS "trending"
|
||||
FROM
|
||||
${windowFunctionTable1}
|
||||
ORDER BY
|
||||
closing_date2;
|
||||
"""
|
||||
|
||||
// LEAD not nullable coredump
|
||||
qt_sql """
|
||||
select t1.new_time from (select closing_date2, lead(closing_date2, 1, '2014-10-02 00:00:00') over () as new_time from ${windowFunctionTable1}) as t1 left join ${windowFunctionTable1} t2 on t2.closing_date2 = t1.closing_date2 order by t1.new_time desc;
|
||||
"""
|
||||
|
||||
// LAG
|
||||
qt_sql """
|
||||
SELECT
|
||||
stock_symbol,
|
||||
closing_date2,
|
||||
closing_price,
|
||||
lag( closing_price, 1, 0 ) over ( PARTITION BY stock_symbol ORDER BY closing_date2 ) AS "yesterday closing"
|
||||
FROM
|
||||
${windowFunctionTable1}
|
||||
ORDER BY
|
||||
closing_date2;
|
||||
"""
|
||||
|
||||
qt_sql """
|
||||
SELECT
|
||||
stock_symbol,
|
||||
closing_date3,
|
||||
closing_price,
|
||||
avg( closing_price ) over ( PARTITION BY stock_symbol ORDER BY closing_date3 rows BETWEEN 1 preceding AND 1 following ) AS moving_average
|
||||
FROM
|
||||
${windowFunctionTable1}
|
||||
ORDER BY
|
||||
stock_symbol,
|
||||
closing_date3,
|
||||
closing_price
|
||||
"""
|
||||
// LEAD
|
||||
qt_sql """
|
||||
SELECT
|
||||
stock_symbol,
|
||||
closing_date3,
|
||||
closing_price,
|
||||
CASE ( lead( closing_price, 1, 0 ) over ( PARTITION BY stock_symbol ORDER BY closing_date3 )- closing_price ) > 0
|
||||
WHEN TRUE THEN "higher"
|
||||
WHEN FALSE THEN "flat or lower" END AS "trending"
|
||||
FROM
|
||||
${windowFunctionTable1}
|
||||
ORDER BY
|
||||
closing_date3;
|
||||
"""
|
||||
|
||||
// LEAD not nullable coredump
|
||||
qt_sql """
|
||||
select t1.new_time from (select closing_date3, lead(closing_date3, 1, '2014-10-02 00:00:00') over () as new_time from ${windowFunctionTable1}) as t1 left join ${windowFunctionTable1} t2 on t2.closing_date3 = t1.closing_date3 order by t1.new_time desc;
|
||||
"""
|
||||
|
||||
// LAG
|
||||
qt_sql """
|
||||
SELECT
|
||||
stock_symbol,
|
||||
closing_date3,
|
||||
closing_price,
|
||||
lag( closing_price, 1, 0 ) over ( PARTITION BY stock_symbol ORDER BY closing_date3 ) AS "yesterday closing"
|
||||
FROM
|
||||
${windowFunctionTable1}
|
||||
ORDER BY
|
||||
closing_date3;
|
||||
"""
|
||||
sql """ drop table ${windowFunctionTable1} """
|
||||
|
||||
|
||||
|
||||
124
regression-test/suites/rollup/test_materialized_view_date.groovy
Normal file
124
regression-test/suites/rollup/test_materialized_view_date.groovy
Normal file
@ -0,0 +1,124 @@
|
||||
// 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.
|
||||
suite("test_materialized_view_date", "rollup") {
|
||||
def tbName1 = "test_materialized_view1"
|
||||
|
||||
def getJobState = { tableName ->
|
||||
def jobStateResult = sql """ SHOW ALTER TABLE MATERIALIZED VIEW WHERE TableName='${tableName}' ORDER BY CreateTime DESC LIMIT 1; """
|
||||
return jobStateResult[0][8]
|
||||
}
|
||||
sql "DROP TABLE IF EXISTS ${tbName1}"
|
||||
sql """
|
||||
CREATE TABLE ${tbName1}(
|
||||
record_id int,
|
||||
seller_id int,
|
||||
store_id int,
|
||||
sale_date date,
|
||||
sale_date1 datev2,
|
||||
sale_datetime1 datetimev2,
|
||||
sale_datetime2 datetimev2(3),
|
||||
sale_datetime3 datetimev2(6),
|
||||
sale_amt bigint
|
||||
)
|
||||
DISTRIBUTED BY HASH(record_id) properties("replication_num" = "1");
|
||||
"""
|
||||
|
||||
int max_try_secs = 60
|
||||
sql "CREATE materialized VIEW amt_max1 AS SELECT store_id, max(sale_date1) FROM ${tbName1} GROUP BY store_id;"
|
||||
while (max_try_secs--) {
|
||||
String res = getJobState(tbName1)
|
||||
if (res == "FINISHED") {
|
||||
break
|
||||
} else {
|
||||
Thread.sleep(2000)
|
||||
if (max_try_secs < 1) {
|
||||
println "test timeout," + "state:" + res
|
||||
assertEquals("FINISHED",res)
|
||||
}
|
||||
}
|
||||
}
|
||||
max_try_secs = 60
|
||||
sql "CREATE materialized VIEW amt_max2 AS SELECT store_id, max(sale_datetime1) FROM ${tbName1} GROUP BY store_id;"
|
||||
while (max_try_secs--) {
|
||||
String res = getJobState(tbName1)
|
||||
if (res == "FINISHED") {
|
||||
break
|
||||
} else {
|
||||
Thread.sleep(2000)
|
||||
if (max_try_secs < 1) {
|
||||
println "test timeout," + "state:" + res
|
||||
assertEquals("FINISHED",res)
|
||||
}
|
||||
}
|
||||
}
|
||||
max_try_secs = 60
|
||||
sql "CREATE materialized VIEW amt_max3 AS SELECT store_id, max(sale_datetime2) FROM ${tbName1} GROUP BY store_id;"
|
||||
while (max_try_secs--) {
|
||||
String res = getJobState(tbName1)
|
||||
if (res == "FINISHED") {
|
||||
break
|
||||
} else {
|
||||
Thread.sleep(2000)
|
||||
if (max_try_secs < 1) {
|
||||
println "test timeout," + "state:" + res
|
||||
assertEquals("FINISHED",res)
|
||||
}
|
||||
}
|
||||
}
|
||||
max_try_secs = 60
|
||||
sql "CREATE materialized VIEW amt_max4 AS SELECT store_id, max(sale_datetime3) FROM ${tbName1} GROUP BY store_id;"
|
||||
while (max_try_secs--) {
|
||||
String res = getJobState(tbName1)
|
||||
if (res == "FINISHED") {
|
||||
break
|
||||
} else {
|
||||
Thread.sleep(2000)
|
||||
if (max_try_secs < 1) {
|
||||
println "test timeout," + "state:" + res
|
||||
assertEquals("FINISHED",res)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sql "SHOW ALTER TABLE MATERIALIZED VIEW WHERE TableName='${tbName1}';"
|
||||
sql "insert into ${tbName1} values(1, 1, 1, '2020-05-30', '2020-05-30', '2020-05-30 11:11:11.111111', '2020-05-30 11:11:11.111111', '2020-05-30 11:11:11.111111',100);"
|
||||
sql "insert into ${tbName1} values(2, 1, 1, '2020-05-30', '2020-05-30', '2020-04-30 11:11:11.111111', '2020-04-30 11:11:11.111111', '2020-04-30 11:11:11.111111',100);"
|
||||
Thread.sleep(1000)
|
||||
explain{
|
||||
sql("SELECT store_id, max(sale_date1) FROM ${tbName1} GROUP BY store_id")
|
||||
contains("(amt_max1)")
|
||||
}
|
||||
explain{
|
||||
sql("SELECT store_id, max(sale_datetime1) FROM ${tbName1} GROUP BY store_id")
|
||||
contains("(amt_max2)")
|
||||
}
|
||||
explain{
|
||||
sql("SELECT store_id, max(sale_datetime2) FROM ${tbName1} GROUP BY store_id")
|
||||
contains("(amt_max3)")
|
||||
}
|
||||
explain{
|
||||
sql("SELECT store_id, max(sale_datetime3) FROM ${tbName1} GROUP BY store_id")
|
||||
contains("(amt_max4)")
|
||||
}
|
||||
qt_sql """ SELECT store_id, max(sale_date1) FROM ${tbName1} GROUP BY store_id """
|
||||
qt_sql """ SELECT store_id, max(sale_datetime1) FROM ${tbName1} GROUP BY store_id """
|
||||
qt_sql """ SELECT store_id, max(sale_datetime2) FROM ${tbName1} GROUP BY store_id """
|
||||
qt_sql """ SELECT store_id, max(sale_datetime3) FROM ${tbName1} GROUP BY store_id """
|
||||
|
||||
sql "DROP TABLE ${tbName1} FORCE;"
|
||||
}
|
||||
83
regression-test/suites/rollup/test_rollup_agg_date.groovy
Normal file
83
regression-test/suites/rollup/test_rollup_agg_date.groovy
Normal file
@ -0,0 +1,83 @@
|
||||
// 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.
|
||||
suite("test_rollup_agg_date", "rollup") {
|
||||
def tbName = "test_rollup_agg"
|
||||
|
||||
def getJobRollupState = { tableName ->
|
||||
def jobStateResult = sql """ SHOW ALTER TABLE ROLLUP WHERE TableName='${tableName}' ORDER BY CreateTime DESC LIMIT 1; """
|
||||
return jobStateResult[0][8]
|
||||
}
|
||||
def getJobColumnState = { tableName ->
|
||||
def jobStateResult = sql """ SHOW ALTER TABLE COLUMN WHERE TableName='${tableName}' ORDER BY CreateTime DESC LIMIT 1; """
|
||||
return jobStateResult[0][9]
|
||||
}
|
||||
sql "DROP TABLE IF EXISTS ${tbName}"
|
||||
sql """
|
||||
CREATE TABLE IF NOT EXISTS ${tbName}(
|
||||
datek1 datev2,
|
||||
datetimek1 datetimev2,
|
||||
datetimek2 datetimev2(3),
|
||||
datetimek3 datetimev2(6),
|
||||
datev1 datev2 MAX NOT NULL,
|
||||
datetimev1 datetimev2 MAX NOT NULL,
|
||||
datetimev2 datetimev2(3) MAX NOT NULL,
|
||||
datetimev3 datetimev2(6) MAX NOT NULL
|
||||
)
|
||||
AGGREGATE KEY (datek1, datetimek1, datetimek2, datetimek3)
|
||||
DISTRIBUTED BY HASH(datek1) BUCKETS 5 properties("replication_num" = "1");
|
||||
"""
|
||||
sql """ALTER TABLE ${tbName} ADD ROLLUP rollup_date(datek1,datetimek1,datetimek2,datetimek3,datev1,datetimev1,datetimev2,datetimev3);"""
|
||||
int max_try_secs = 60
|
||||
while (max_try_secs--) {
|
||||
String res = getJobRollupState(tbName)
|
||||
if (res == "FINISHED") {
|
||||
break
|
||||
} else {
|
||||
Thread.sleep(2000)
|
||||
if (max_try_secs < 1) {
|
||||
println "test timeout," + "state:" + res
|
||||
assertEquals("FINISHED",res)
|
||||
}
|
||||
}
|
||||
}
|
||||
Thread.sleep(200)
|
||||
sql "ALTER TABLE ${tbName} ADD COLUMN datetimev4 datetimev2(3) MAX NULL TO rollup_date;"
|
||||
max_try_secs = 60
|
||||
while (max_try_secs--) {
|
||||
String res = getJobColumnState(tbName)
|
||||
if (res == "FINISHED") {
|
||||
break
|
||||
} else {
|
||||
Thread.sleep(2000)
|
||||
if (max_try_secs < 1) {
|
||||
println "test timeout," + "state:" + res
|
||||
assertEquals("FINISHED",res)
|
||||
}
|
||||
}
|
||||
}
|
||||
sql "SHOW ALTER TABLE ROLLUP WHERE TableName='${tbName}';"
|
||||
qt_sql "DESC ${tbName} ALL;"
|
||||
sql "insert into ${tbName} values('2022-08-22', '2022-08-22 11:11:11.111111', '2022-08-22 11:11:11.111111', '2022-08-22 11:11:11.111111', '2022-08-22', '2022-08-22 11:11:11.111111', '2022-08-22 11:11:11.111111', '2022-08-22 11:11:11.111111', '2022-08-22 11:11:11.111111');"
|
||||
sql "insert into ${tbName} values('2022-08-23', '2022-08-23 11:11:11.111111', '2022-08-23 11:11:11.111111', '2022-08-23 11:11:11.111111', '2022-08-23', '2022-08-23 11:11:11.111111', '2022-08-23 11:11:11.111111', '2022-08-23 11:11:11.111111', '2022-08-23 11:11:11.111111');"
|
||||
explain {
|
||||
sql("SELECT datek1,datetimek1,datetimek2,datetimek3,max(datev1),max(datetimev1),max(datetimev2),max(datetimev3) FROM ${tbName} GROUP BY datek1,datetimek1,datetimek2,datetimek3")
|
||||
contains("(rollup_date)")
|
||||
}
|
||||
qt_sql """ SELECT datek1,datetimek1,datetimek2,datetimek3,max(datev1),max(datetimev1),max(datetimev2),max(datetimev3) FROM ${tbName} GROUP BY datek1,datetimek1,datetimek2,datetimek3; """
|
||||
sql "ALTER TABLE ${tbName} DROP ROLLUP rollup_date;"
|
||||
sql "DROP TABLE ${tbName} FORCE;"
|
||||
}
|
||||
Reference in New Issue
Block a user