feat: rename default ts to GREPTIME_TIMESTAMP

This commit is contained in:
discord9
2024-05-20 19:10:35 +08:00
parent d1ce436442
commit 8f40ba42c1
2 changed files with 5 additions and 4 deletions

View File

@@ -26,6 +26,7 @@ use common_base::Plugins;
use common_error::ext::BoxedError;
use common_frontend::handler::FrontendInvoker;
use common_meta::key::TableMetadataManagerRef;
use common_query::prelude::GREPTIME_TIMESTAMP;
use common_runtime::JoinHandle;
use common_telemetry::{debug, info};
use datatypes::schema::ColumnSchema;
@@ -281,7 +282,7 @@ impl FlownodeManager {
let schema = meta.schema.column_schemas;
let is_auto_create = schema
.last()
.map(|s| s.name == "__ts_placeholder")
.map(|s| s.name == GREPTIME_TIMESTAMP)
.unwrap_or(false);
(primary_keys, schema, is_auto_create)
} else {
@@ -318,7 +319,7 @@ impl FlownodeManager {
);
// TODO(discord9): bugged so we can't infer time index from flow plan, so we have to manually set one
let ts_col = ColumnSchema::new(
"__ts_placeholder",
"GREPTIME_TIMESTAMP",
ConcreteDataType::timestamp_millisecond_datatype(),
true,
)
@@ -676,6 +677,6 @@ impl FlowTickManager {
pub fn tick(&self) -> repr::Timestamp {
let current = Instant::now();
let since_the_epoch = current - self.start;
since_the_epoch.as_millis() as repr::Timestamp
since_the_epoch.as_millis() as repr::Timestamp + self.start_timestamp
}
}

View File

@@ -434,7 +434,7 @@ mod test {
use crate::plan::{Plan, TypedPlan};
use crate::repr::{self, ColumnType, RelationType};
use crate::transform::test::{create_test_ctx, create_test_query_engine, sql_to_substrait};
/// TODO(discord9): add more illegal sql tests
#[tokio::test]
async fn test_tumble_compsite() {
let engine = create_test_query_engine();