Skip to content

Instantly share code, notes, and snippets.

View SudhenduP's full-sized avatar
🏠
Working from home

Sudhendu SudhenduP

🏠
Working from home
View GitHub Profile
fig = px.line_3d(
filtered_df1,
x="X_VALUE",
y="Y_VALUE",
z="TVD",
template="plotly_dark",
)
fig.update_layout(width=800,
height=800,
autosize=False,
session = get_active_session()
get_well_direction_df = session.table("WELL_ST.SUMMARY.WELL_DIRECTION").to_pandas()
@SudhenduP
SudhenduP / import.py
Created October 13, 2023 16:51
3D Well Path 1
import pandas as pd
import streamlit as st
from snowflake.snowpark.context import get_active_session
import plotly.express as px
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
#,Checklist,Detail,More Information
1,Have you done the initial analysis of where Snowflake fits?,"It is essential to understand where Snowflake fits for your requirement. True that Snowflake is a cloud data warehouse, but that is just one offering of Snowflake.",Why Snowflake Data Cloud | Snowflake Data Cloud
2,Have you listed down all the possible use-cases (current and future),Use-cases are your industry/department specific goals. Snowflake support a plethora of use-cases and it is worth checking if there is already a solution created for your use-cases,Industry Solutions | Snowflake
3,What different workloads do you plan to use Snowflake for?,Have you gone through different workload Snowflake can support? Do you foresee a opportunity there?,https://www.snowflake.com/guides/
4,Do you foresee using Snowflake for you own team/department or for the entire organisation?,"This is important to consider early on as it helps you make decision on long-term strategy. Snowflake, just like any cloud native tool has hu
date_ky movie_id screen_id cust_code tickets price
100122 443 6 JEN 5 22
180222 224 4 RAL 4 41
190122 443 4 TIS 6 53
220122 921 3 BOB 1 15
280122 443 3 VIC 1 20
280122 921 5 LUC 2 44
050222 921 5 SON 1 67
110222 224 1 ENG 2 23
230222 443 1 SAD 8 10
-- Start with using the AccountAdmin Role to create the required roles, datawarehouse, database and grant sufficient privileges.
-- Note, in actual client implementation, you should avoid using ACCOUNTADMIN role and instead use SYSADMIN.
USE ROLE ACCOUNTADMIN;
-- Role creation and premission grants.
DROP ROLE IF EXISTS IDENTIFIER('"POC_DATACLASSIFICATION"');
CREATE ROLE IDENTIFIER('"POC_DATACLASSIFICATION"') COMMENT = 'Role for Data Classification';
-- Please add your username below instead of USERNAME.
-- change the role
USE ROLE ACCOUNTADMIN;
-- create necessary database objects
CREATE DATABASE KAFKA_CONNECT_DB;
CREATE ROLE KAFKA_CONNECT_ROLE;
CREATE SCHEMA KAFKA_CONNECT_DB.KAFKA_CONNECT_SCHEMA;
CREATE TABLE KAFKA_TABLE_IN (RECORD_METADATA VARIANT, RECORD_CONTENT VARIANT);
CREATE WAREHOUSE KAFKA_WAREHOUSE WITH WAREHOUSE_SIZE = 'XSMALL' WAREHOUSE_TYPE = 'STANDARD' AUTO_SUSPEND = 300 AUTO_RESUME = TRUE;
@SudhenduP
SudhenduP / SF_connect.properties
Last active September 5, 2021 15:45
For Snowflake kafka connect
name=mykafkaconnectsnowflake
connector.class=com.snowflake.kafka.connector.SnowflakeSinkConnector
tasks.max=8
topics=snowflake_in_topic
snowflake.topic2table.map= snowflake_in_topic:KAFKA_TABLE_IN
buffer.count.records=1
buffer.flush.time=10
buffer.size.bytes=5
snowflake.url.name=abc1234.snowflakecomputing.com:443
snowflake.user.name=thisismyusername
╔══════╦══════╦════════╗
║ Database Object ║ Privileges ║
╠══════╬══════╬════════╣
║ Database ║ USAGE ║
║ Schema ║ USAGE CREATE TABLE CREATE STAGE CREATE PIPE ║
║ Table ║ OWNERSHIP ║
║ Stage ║ READ WRITE ║
╚══════╩══════╩════════╝