Skip to content

Commit

Permalink
tweak updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pgguru committed Oct 28, 2024
1 parent 187f055 commit 4ffd535
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/parquet_copy_hook/copy_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use pgrx::{
};
use url::Url;

use crate::pgrx_utils::{array_element_typoid, is_supported_array_element_type};

use crate::arrow_parquet::{
compression::{all_supported_compressions, PgParquetCompression},
parquet_writer::{DEFAULT_ROW_GROUP_SIZE, DEFAULT_ROW_GROUP_SIZE_BYTES},
Expand Down Expand Up @@ -487,9 +489,7 @@ pub(crate) fn create_filtered_tupledesc_for_relation<'a>(
let att_typmod = attribute.type_mod();
let att_ndims = attribute.attndims;

if att_ndims > 0
&& !is_supported_array_element_type(array_element_typoid(type_att_typoid))
{
if att_ndims > 0 && !is_supported_array_element_type(array_element_typoid(att_typoid)) {
panic!(
"column \"{}\" of relation \"{}\" is of unsupported type",
attribute_name,
Expand Down
8 changes: 8 additions & 0 deletions src/pgrx_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ pub(crate) fn collect_valid_attributes(
name
);
}

if unsafe {
type_is_array(attribute.atttypid)
&& !is_supported_array_element_type(get_element_type(attribute.atttypid))
} {
panic!("unsupported array attribute for field \"{}\"", name);
}

attributes_set.insert(name);

attributes.push(attribute.to_owned());
Expand Down

0 comments on commit 4ffd535

Please sign in to comment.