This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select l.pid, relation::regclass, mode, a.application_name, a.query_start, locktype, | |
(classid::bigint << 32) | objid::bigint as hash | |
from pg_locks l join pg_stat_activity a on l.pid = a.pid where granted; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT schema_name, | |
pg_size_pretty(sum(table_size)::bigint), | |
(sum(table_size) / pg_database_size(current_database())) * 100 | |
FROM ( | |
SELECT pg_catalog.pg_namespace.nspname as schema_name, | |
pg_relation_size(pg_catalog.pg_class.oid) as table_size | |
FROM pg_catalog.pg_class | |
JOIN pg_catalog.pg_namespace ON relnamespace = pg_catalog.pg_namespace.oid | |
) t | |
GROUP BY schema_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sourceSets { | |
create("integrationTest") { | |
compileClasspath += main.get().output + configurations.testRuntimeClasspath | |
runtimeClasspath += output + compileClasspath | |
} | |
} | |
val integrationTestImplementation: Configuration by configurations.getting { | |
extendsFrom(configurations.implementation.get()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.parquet.hadoop.ParquetOutputFormat | |
import org.apache.spark.sql.SaveMode | |
import org.apache.spark.sql.SparkSession | |
fun main() { | |
val session = createSparkSession("test", 1) | |
val df = session.read().format("jdbc") | |
.option("url", "jdbc:postgresql://localhost:6432/pg-atlas-v2-stg-other?user=postgres") | |
.option("query", """select * from usdt_trx_udm_v2_transactions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := x / 2 | |
epsilon := 0.001 |
OlderNewer