do not replace tablescans for information_schema (#764)

We shouldn't be replacing 'TableScan's for `information_schema` and
`hasura` schemas. Previously, we only had a check for `hasura` schema,
this PR now includes a check for `information_schema`. Queries on
`information_schema` will now work.

V3_GIT_ORIGIN_REV_ID: b25276556027b52ff940ddd3d094ea20f6fc7538
This commit is contained in:
Vamshi Surabhi 2024-06-26 05:10:16 +05:30 committed by hasura-bot
parent 8af78227a0
commit 44a8fcd0f4

View File

@ -36,7 +36,7 @@ use metadata_resolve::{self as resolved};
use open_dds::identifier::Identifier;
use open_dds::types::FieldName;
use crate::plan::NDCQuery;
use crate::{catalog::introspection::HASURA_METADATA_SCHEMA, plan::NDCQuery};
/// Analyzed rule that inlines TableScan that provide a [`LogicalPlan`]
/// (DataFrame / ViewTable)
@ -92,7 +92,9 @@ fn analyze_internal(
projected_schema,
filters: _,
fetch: _,
}) if table_name.schema() != Some("hasura") => {
}) if table_name.schema() != Some(HASURA_METADATA_SCHEMA)
&& table_name.schema() != Some("information_schema") =>
{
let table = catalog.get(default_schema, &table_name).ok_or_else(|| {
DataFusionError::Internal(format!(
"table provider not found for replace_table_scan: {table_name}"