Skip to content

Commit

Permalink
address CR.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachelint committed Mar 16, 2023
1 parent 6506ffa commit 67b58b7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions sql/src/influxql/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,14 @@ fn map_column_to_influx_column(
is_timestamp_key: bool,
) -> Result<InfluxColumnType> {
if is_timestamp_key {
map_column_to_influx_time_column(column)
} else if column.is_tag {
map_column_to_influx_tag_column(column)
} else {
map_column_to_influx_field_column(column)
return map_column_to_influx_time_column(column);
}

if column.is_tag {
return map_column_to_influx_tag_column(column);
}

map_column_to_influx_field_column(column)
}

fn map_column_to_influx_time_column(column: &ColumnSchema) -> Result<InfluxColumnType> {
Expand All @@ -144,6 +146,7 @@ fn map_column_to_influx_time_column(column: &ColumnSchema) -> Result<InfluxColum
}
}

// TODO: support more tag types.
fn map_column_to_influx_tag_column(column: &ColumnSchema) -> Result<InfluxColumnType> {
// Tag column
if matches!(column.data_type, DatumKind::String) && column.is_nullable {
Expand All @@ -156,6 +159,7 @@ fn map_column_to_influx_tag_column(column: &ColumnSchema) -> Result<InfluxColumn
}
}

// TODO: support more field types.
fn map_column_to_influx_field_column(column: &ColumnSchema) -> Result<InfluxColumnType> {
if column.is_nullable {
match column.data_type {
Expand Down

0 comments on commit 67b58b7

Please sign in to comment.