Skip to content

Commit

Permalink
remove sdk related code
Browse files Browse the repository at this point in the history
  • Loading branch information
tanruixiang committed Jun 28, 2023
1 parent d885790 commit 1e1437e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
4 changes: 0 additions & 4 deletions interpreters/src/describe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ impl DescribeInterpreter {
let mut is_primary_keys = Vec::with_capacity(num_columns);
let mut is_nullables = Vec::with_capacity(num_columns);
let mut is_tags = Vec::with_capacity(num_columns);
let mut is_dictionarys = Vec::with_capacity(num_columns);
for (idx, col) in table_schema.columns().iter().enumerate() {
names.push(col.name.to_string());
types.push(col.data_type.to_string());
is_primary_keys.push(table_schema.is_primary_key_index(&idx));
is_nullables.push(col.is_nullable);
is_tags.push(col.is_tag);
is_dictionarys.push(col.is_dictionary);
}

let schema = Schema::new(vec![
Expand All @@ -62,7 +60,6 @@ impl DescribeInterpreter {
Field::new("is_primary", DataType::Boolean, false),
Field::new("is_nullable", DataType::Boolean, false),
Field::new("is_tag", DataType::Boolean, false),
Field::new("is_dictionary", DataType::Boolean, false),
]);

let arrow_record_batch = RecordBatch::try_new(
Expand All @@ -73,7 +70,6 @@ impl DescribeInterpreter {
Arc::new(BooleanArray::from(is_primary_keys)),
Arc::new(BooleanArray::from(is_nullables)),
Arc::new(BooleanArray::from(is_tags)),
Arc::new(BooleanArray::from(is_dictionarys)),
],
)
.unwrap();
Expand Down
5 changes: 0 additions & 5 deletions interpreters/src/show_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ impl ShowCreateInterpreter {
if col.is_tag {
res += " TAG";
}

if col.is_dictionary {
res += " DICTIONARY";
}

if !col.is_nullable {
res += " NOT NULL";
}
Expand Down
21 changes: 10 additions & 11 deletions interpreters/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,17 @@ where
let sql = "desc table test_table";
let output = self.sql_to_output(sql).await.unwrap();
let records = output.try_into().unwrap();
// todo this maybe need to change
let expected = vec![
"+--------+-----------+------------+-------------+--------+---------------+",
"| name | type | is_primary | is_nullable | is_tag | is_dictionary |",
"+--------+-----------+------------+-------------+--------+---------------+",
"| key1 | varbinary | true | false | false | false |",
"| key2 | timestamp | true | false | false | false |",
"| field1 | double | false | true | false | false |",
"| field2 | string | false | true | false | false |",
"| field3 | date | false | true | false | false |",
"| field4 | time | false | true | false | false |",
"+--------+-----------+------------+-------------+--------+---------------+",
"+--------+-----------+------------+-------------+--------+",
"| name | type | is_primary | is_nullable | is_tag |",
"+--------+-----------+------------+-------------+--------+",
"| key1 | varbinary | true | false | false |",
"| key2 | timestamp | true | false | false |",
"| field1 | double | false | true | false |",
"| field2 | string | false | true | false |",
"| field3 | date | false | true | false |",
"| field4 | time | false | true | false |",
"+--------+-----------+------------+-------------+--------+",
];
common_util::record_batch::assert_record_batches_eq(&expected, records);
}
Expand Down

0 comments on commit 1e1437e

Please sign in to comment.