diff --git a/Pasted image 20250415152322.png b/Pasted image 20250415152322.png new file mode 100644 index 0000000..89c4dde Binary files /dev/null and b/Pasted image 20250415152322.png differ diff --git a/work常用/python/pip 、pipenv.md b/work常用/python/pip 、pipenv.md index 17d2133..75bac15 100644 --- a/work常用/python/pip 、pipenv.md +++ b/work常用/python/pip 、pipenv.md @@ -2,6 +2,7 @@ ## 1. 镜像加速 ```shell # 添加 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com +# 阿里云 -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com pip install 'acryl-datahub[oracle]' -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn ``` diff --git a/work常用/中间件/seatunnel/Kafka-TO-hive.md b/work常用/中间件/seatunnel/Kafka-TO-hive.md new file mode 100644 index 0000000..6079629 --- /dev/null +++ b/work常用/中间件/seatunnel/Kafka-TO-hive.md @@ -0,0 +1,46 @@ +hive 是分区表,需要在transform指定分区字段,例(y_birth),另外hive_site_path和hdfs_site_path 需要和metastore_uri保持一致,即hive客户端均为同一个。 + +```hocon +env { + parallelism = 1 + job.mode = "STREAMING" +} +source { + Kafka { + schema = { + fields { + name = "string" + age = "int" + y_birth = "int" + } + } + topic = "ST_DATA" + bootstrap.servers = "172.31.51.241:9092,172.31.51.242:9092,172.31.51.243:9092" + kafka.config = { + client.id = client_1 + auto.offset.reset = "latest" + } + } +} +transform { + FieldMapper { + field_mapper = { + name = name + age = age + y_birth = y_birth + } + } +} +sink { + Hive { + metastore_uri = "thrift://bg1:9083" + table_name = "ods.zr_test_table" + hive_site_path = "/opt/datasophon/hive-3.1.3/conf/hive-site.xml" + hdfs_site_path="/opt/datasophon/hadoop/etc/hadoop/hdfs-site.xml" + } +} +``` + + +hive 表建表语句 +![[Pasted image 20250415152322.png]] \ No newline at end of file diff --git a/work常用/数据库/Postgresql 常用SQL.md b/work常用/数据库/Postgresql 常用SQL.md index 1924ca4..dbc5c0a 100644 --- a/work常用/数据库/Postgresql 常用SQL.md +++ b/work常用/数据库/Postgresql 常用SQL.md @@ -25,6 +25,24 @@ SELECT format_type(a.atttypid,a.atttypmod) as data_type, col_description(a.attrelid,a.attnum) as comment FROM pg_class as c,pg_attribute as a where a.attrelid = c.oid and a.attnum>0 and c.relname = 'Edge_0101'; + +-- 或者 +SELECT a.attnum, a.attname AS field, t.typname AS type, a.attlen AS length, a.atttypmod AS lengthvar + , a.attnotnull AS notnull, b.description AS comment +FROM pg_class c, pg_attribute a + LEFT JOIN pg_description b + ON a.attrelid = b.objoid + AND a.attnum = b.objsubid, pg_type t +WHERE c.relname = 'pg_replication_slots' + AND a.attnum > 0 + AND a.attrelid = c.oid + AND a.atttypid = t.oid +ORDER BY a.attnum; + +10.查看所有进程 +SELECT * FROM pg_stat_activity WHERE datname='数据库名' +11.根据pid结束进程 +select pg_cancel_backend(pid) ``` ## 二、函数 diff --git a/本机环境/开发环境.md b/本机环境/开发环境.md index 338a62d..305da4b 100644 --- a/本机环境/开发环境.md +++ b/本机环境/开发环境.md @@ -213,4 +213,7 @@ http://localhost:8081/#/overview ```shell docker pull marqoai/marqo:latest docker run --name marqo -it --privileged -p 8882:8882 --add-host host.docker.internal:host-gateway marqoai/marqo:latest + +-- GPU运行 +docker run --name marqo -it --privileged --gpus all -p 8882:8882 --add-host host.docker.internal:host-gateway marqoai/marqo:latest ```