fix: allow .(dot) literal in table name (#2483)

* fix: allow `.`(dot) literal in table name

* fix: resolve PR comments
This commit is contained in:
LFC
2023-09-27 19:50:07 +08:00
committed by GitHub
parent ee8d472aae
commit ccd6de8d6b
5 changed files with 22 additions and 36 deletions

View File

@@ -13,9 +13,6 @@
// limitations under the License.
use consts::DEFAULT_CATALOG_NAME;
use snafu::ensure;
use crate::error::Result;
pub mod consts;
pub mod error;
@@ -26,17 +23,6 @@ pub fn format_full_table_name(catalog: &str, schema: &str, table: &str) -> Strin
format!("{catalog}.{schema}.{table}")
}
pub fn parse_full_table_name(table_name: &str) -> Result<(&str, &str, &str)> {
let result = table_name.split('.').collect::<Vec<_>>();
ensure!(
result.len() == 3,
error::InvalidFullTableNameSnafu { table_name }
);
Ok((result[0], result[1], result[2]))
}
/// Build db name from catalog and schema string
pub fn build_db_string(catalog: &str, schema: &str) -> String {
if catalog == DEFAULT_CATALOG_NAME {