Skip to content

Instantly share code, notes, and snippets.

View vvgsrk's full-sized avatar

Venkata Gowri Sai Rakesh Kumar Varanasi vvgsrk

View GitHub Profile
@vvgsrk
vvgsrk / HR_CSV_DATA_PARSER_USING_PYTHON_PANDAS.ipynb
Created July 29, 2021 14:04
HR CSV Data Parser Using Python and Pandas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vvgsrk
vvgsrk / DESCRIBE_MATERIALIZED_VIEW.sql
Created July 29, 2021 06:19
Describes the columns in a materialized view
DESCRIBE MATERIALIZED VIEW dm_rmp.infare;
@vvgsrk
vvgsrk / SHOW_MATERIALIZED_VIEWS.sql
Created July 29, 2021 06:08
Lists the materialized views that you have privileges to access.
SHOW MATERIALIZED VIEWS LIKE 'INFARE' IN DATABASE;
@vvgsrk
vvgsrk / INFARE_MATERIALIZED_VIEW.sql
Last active July 28, 2021 14:09
Materialized view for infare external table
CREATE OR REPLACE MATERIALIZED VIEW dp_prod.dm_rmp.infare
COMMENT = 'Materialized view for infare external table'
CLUSTER BY (observation_date)
AS
SELECT
id,
observation_date,
observation_time,
pos,
origin,
@vvgsrk
vvgsrk / DESCRIBE_EXTERNAL_TABLE.sql
Created July 28, 2021 12:51
Describes the VALUE column and virtual columns in an external table
DESCRIBE EXTERNAL TABLE dp_prod.raw_rmp.infare_external_table;
@vvgsrk
vvgsrk / SHOW_EXTERNAL_TABLES_IN_DATABASE.sql
Created July 28, 2021 12:46
Lists the external tables for which you have access privileges
SHOW EXTERNAL TABLES LIKE 'infare_external_table' IN DATABASE;
@vvgsrk
vvgsrk / infare_external_table.sql
Created July 28, 2021 12:39
Snowflake External Table with Auto Ingest
CREATE OR REPLACE EXTERNAL TABLE dp_prod.raw_rmp.infare_external_table (
date_partition date as to_date(concat(substr(METADATA$FILENAME, 31, 4), '-', substr(METADATA$FILENAME, 39, 2), '-', substr(METADATA$FILENAME, 45, 2)), 'YYYY-MM-DD'),
id int as (value:id::int),
observation_date date as (TO_TIMESTAMP(value:observation_date)::date),
observation_time varchar as (value:observation_time::varchar),
pos varchar as (value:pos::varchar),
origin varchar as (value:origin::varchar),
destination varchar as (value:destination::varchar),
is_one_way int as (value:is_one_way::int),
outbound_travel_stop_over varchar as (value:outbound_travel_stop_over::varchar),
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
CREATE TABLE db_dev.revenue.od_forecast_booking(
depature_airport VARCHAR,
arrival_airport VARCHAR,
depature_date DATE,
airline_code VARCHAR,
flight_number VARCHAR,
flight_cabin VARCHAR,
booking_class VARCHAR
);
SHOW PROCEDURES LIKE 'fa_unload_sp' IN db_dev.revenue;
DESCRIBE PROCEDURE db_dev.revenue.fa_unload_sp();
SELECT *
FROM information_schema.procedures
WHERE procedure_catalog = 'AYDP_DEV'
AND procedure_schema = 'PUBLIC'
AND procedure_name = 'FA_UNLOAD_SP';