The DISTINCT function on a parquet table that is loaded into SAS® Cloud Analytic Services (CAS) MPP generates an "Access Violation" error


A Parquet table loaded into CAS in a SAS® Viya® 3.5 MPP environment might generate an Access Violation error when a DISTINCT operation is performed. This behavior can occur both when executing SAS code that includes a DISTINCT operation and when opening or browsing a SAS® Visual Analytics report that triggers a DISTINCT operation on the affected table.

Here is an example with an AMEX parquet table:

proc casutil incaslib=your_caslib outcaslib=your_caslib;
load casdata="your_table.parquet"
casout="table_test"
promote
label="table_test";
run;

proc cas;
simple.distinct /
table={name='table_test', caslib='your_caslib', computedOnDemand=false}
inputs=name='column_name'
casOut={name='distinct_results', replace=true};
quit;

This table produces the following error:

ERROR: Fatal error, action aborted: Access violation
NOTE: Executing action 'simple.distinct' (attempt #2).
ERROR: Fatal error, action aborted: Access violation
ERROR: Access violation
ERROR: The action stopped due to errors.
NOTE: PROCEDURE CAS used (Total process time):
      real time           4.46 seconds
      cpu time            0.08 seconds

On the CAS controller, the log contains only the following error message:
 
'Simple.Distinct' FAILED. The action cannot continue due to communication failures among server nodes.
 
Similarly, the CAS worker logs do not contain any relevant errors or messages associated with the failure.

Cause

Certain Parquet files do not include VARCHAR length information in their metadata. Consequently, the column schema is not properly propagated to the CAS workers, which results in an invalid schema definition during distributed processing.

This issue occurs in only SAS Viya 3.5 MPP environments, where processing is distributed between the CAS controller and CAS workers. SAS Viya 3.5 SMP deployments are not affected.