Skip to content

Instantly share code, notes, and snippets.

Avatar

Kanthi subkanthi

View GitHub Profile
@subkanthi
subkanthi / modify_column.sql
Last active April 11, 2023 18:26
Modify column clickhouse (NULL not retained unless specified) vs MySQL
View modify_column.sql
create table test_modify(uid String, newcol Nullable(String)) Engine=MergeTree() order by uid;
CREATE TABLE test_modify
(
`uid` String,
`newcol` Nullable(String)
)
ENGINE = MergeTree
ORDER BY uid
@subkanthi
subkanthi / session_example.java
Last active March 22, 2023 22:26
Sessions in Clickhouse JDBC (0.3.2-patch11)
View session_example.java
// https://github.com/ClickHouse/ClickHouse/blob/58db4b7be4f326f5c30dccf3372172d83912f282/dbms/tests/queries/0_stateless/00463_sessions_in_http_interface.sh
// Pass a unique id to session_id and open a new connection.
ClickHouseDataSource dataSource = new ClickHouseDataSource(url + "?session_id=1", properties);
ClickHouseConnection conn = dataSource.getConnection(userName, "");
dataSource.getConnection().prepareStatement("set max_rows_to_read=7777777").execute();
// Set the setting - max_rows_to_read
ResultSet rs = dataSource.getConnection().prepareStatement("select * from system.settings where name='max_rows_to_read'").executeQuery();
@subkanthi
subkanthi / docker-compose.yaml
Created January 10, 2023 03:54
sink connector(basic components without monitoring)
View docker-compose.yaml
version: "3.4"
# Ubuntu , set this for redpanda to start
# https://sort.veritas.com/public/documents/HSO/2.0/linux/productguides/html/hfo_admin_ubuntu/ch04s03.htm
# Clickhouse Table Schema
# create table test(id int, message String) ENGINE=MergeTree() PRIMARY KEY id;
services:
mysql-master: