版本:2.0.12
show stream load查看审计日志库下的stream load记录
报错no partition for this tuple,如下图所示:
版本:2.0.12
show stream load查看审计日志库下的stream load记录
报错no partition for this tuple,如下图所示:
这个是因为你插入的数据没有对应的分区导致的,你的动态分区start=-180,过去半年的数据你都是可以导入的,但是1900年的数据不在这个范围内,因此会报错。
1900-01-01这个时间
建表语句
CREATE TABLE `doris_audit_log_tbl__` (
`query_id` VARCHAR(48) NULL COMMENT 'Unique query id',
`time` DATETIME NOT NULL COMMENT 'Query start time',
`client_ip` VARCHAR(32) NULL COMMENT 'Client IP',
`user` VARCHAR(64) NULL COMMENT 'User name',
`db` VARCHAR(96) NULL COMMENT 'Database of this query',
`state` VARCHAR(8) NULL COMMENT 'Query result state. EOF, ERR, OK',
`error_code` INT NULL COMMENT 'Error code of failing query.',
`error_message` TEXT NULL COMMENT 'Error message of failing query.',
`query_time` BIGINT NULL COMMENT 'Query execution time in millisecond',
`scan_bytes` BIGINT NULL COMMENT 'Total scan bytes of this query',
`scan_rows` BIGINT NULL COMMENT 'Total scan rows of this query',
`return_rows` BIGINT NULL COMMENT 'Returned rows of this query',
`stmt_id` INT NULL COMMENT 'An incremental id of statement',
`is_query` TINYINT NULL COMMENT 'Is this statemt a query. 1 or 0',
`frontend_ip` VARCHAR(32) NULL COMMENT 'Frontend ip of executing this statement',
`cpu_time_ms` BIGINT NULL COMMENT 'Total scan cpu time in millisecond of this query',
`sql_hash` VARCHAR(48) NULL COMMENT 'Hash value for this query',
`sql_digest` VARCHAR(48) NULL COMMENT 'Sql digest for this query',
`peak_memory_bytes` BIGINT NULL COMMENT 'Peak memory bytes used on all backends of this query',
`stmt` TEXT NULL COMMENT 'The original statement, trimed if longer than 2G'
) ENGINE = OLAP DUPLICATE KEY(`query_id`, `time`, `client_ip`) PARTITION BY RANGE(`time`) () DISTRIBUTED BY HASH(`query_id`) BUCKETS 1 PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"is_being_synced" = "false",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.replication_allocation" = "tag.location.default: 3",
"dynamic_partition.buckets" = "1",
"dynamic_partition.create_history_partition" = "false",
"dynamic_partition.history_partition_num" = "-1",
"dynamic_partition.hot_partition_num" = "0",
"dynamic_partition.reserved_history_periods" = "NULL",
"dynamic_partition.storage_policy" = "",
"storage_format" = "V2",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false"
);
审计日志内容
2024-06-26 23:57:08,860 [query] |Client=|User=|Db=__internal_schema|State=OK|ErrorCode=0|ErrorMessage=|Time(ms)=37|ScanBytes=0|ScanRows=0|ReturnRows=0|StmtId=0|QueryId=c6b8ec7f8233482f-92ad0c19e9136a96|IsQuery=true|isNereids=true|feIp=xxx|Stmt=OriginStatement{originStmt='SELECT * FROM `default_cluster:__internal_schema`.`column_statistics` WHERE `id` = '262848--1-extra'', idx=0}|CpuTimeMS=4|SqlHash=|peakMemoryBytes=425392|SqlDigest=|TraceId=|WorkloadGroup=|FuzzyVariables=