Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/query/ee/src/storages/fuse/operations/virtual_columns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ pub async fn do_refresh_virtual_column(
});

if !fuse_table.support_virtual_columns() {
return Err(ErrorCode::VirtualColumnError(
"table don't support virtual column".to_string(),
));
return Err(ErrorCode::VirtualColumnError(format!(
"Table don't support virtual column, storage_format: {} read_only: {}",
fuse_table.get_storage_format(),
fuse_table.is_read_only()
)));
}
let virtual_column_builder = VirtualColumnBuilder::try_create(ctx.clone(), source_schema)?;

Expand Down
4 changes: 1 addition & 3 deletions src/query/storages/fuse/src/fuse_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1273,9 +1273,7 @@ impl Table for FuseTable {
}

fn support_virtual_columns(&self) -> bool {
if matches!(self.storage_format, FuseStorageFormat::Parquet)
&& matches!(self.table_type, FuseTableType::Standard)
{
if matches!(self.storage_format, FuseStorageFormat::Parquet) && !self.is_read_only() {
// ignore persistent system tables {
if let Ok(database_name) = self.table_info.database_name() {
if database_name == "persistent_system" {
Expand Down
11 changes: 11 additions & 0 deletions src/query/storages/fuse/src/fuse_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::fmt::Display;
use std::fmt::Formatter;
use std::str::FromStr;

use databend_common_exception::ErrorCode;
Expand Down Expand Up @@ -50,6 +52,15 @@ pub enum FuseStorageFormat {
Native,
}

impl Display for FuseStorageFormat {
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
match self {
FuseStorageFormat::Parquet => write!(f, "Parquet"),
FuseStorageFormat::Native => write!(f, "Native"),
}
}
}

impl FromStr for FuseStorageFormat {
type Err = ErrorCode;

Expand Down
Loading