hongbo-miao/hongbomiao.com

View on GitHub
data-storage/snowflake/read-snowflake-by-matlab/main.m

Summary

Maintainability
Test Coverage
conn = database('hm-snowflake', 'production_tracker_db_public_readonly', 'xxx');

fieldNames = {'record_metadata', 'record_content'};

columnNames = strjoin(fieldNames, ', ');
sqlQuery = [
            'select ', columnNames, ' ', ...
            'from production_tracker_db.public.analytic_events'
           ];
data = fetch(conn, sqlQuery);

close(conn);

clear columnNames;
clear conn;
clear fieldNames;
clear sqlQuery;