| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
- Redshift
- django
- PostgreSQL
- Apache
- Kotlin
- numpy
- Google Excel
- GIT
- Excel
- matplotlib
- Google Spreadsheet
- array
- gas
- google apps script
- Presto
- dataframe
- 파이썬
- Java
- hive
- string
- math
- c#
- PySpark
- PANDAS
- SQL
- list
- Python
- Tkinter
- Github
- Today
- Total
목록SQL (132)
달나라 노트
Hive에서 schema의 정보를 보고 싶으면 show create schema을 이용하면 됩니다. Syntaxshow create schema schema_name; show create schema test_schema;-- ResultCREATE DATABASE `test_schema`LOCATION '~~' show create schema를 사용하면 위처럼 schema와 schema의 타겟 위치가 출력됩니다.
Hive에서 table에 있는 column 등 table의 정보를 보고 싶으면 show create table을 이용하면 됩니다. Syntaxshow create table schema.table; show create table schema.table;-- ResultCREATE TABLE `test_schema.test_table` ( `id` bigint, `name` string, `price` bigint)ROQ FORMAT SERDE 'org.apache.hadoop.hive.ql.io.orc.OrcSerde'SRORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'OUTPUTFORMA..
어떤 날짜에 대해 해당 주차의 시작 날짜로 truncate을 하고 싶다면 크게 2가지 방법이 있습니다. 오늘 날짜가 2024-07-25 (목)이라고 가정하겠습니다. 1. date_trunc 함수 사용date_turnc('week', current_date);-- Result2024-07-22 date_trunc() 함수는 월요일을 일주일의 시작으로 간주합니다.오늘이 2024-07-25(목)이므로 같은 주의 월요일로 truncate을 합니다.따라서 위 결과는 2024-07-22가 됩니다. https://cosmosproject.tistory.com/170 2021-02-" data-og-host="cosmosproject.tistory.com" data-og-source-url="https://cosm..
alter table ~ add ~를 이용하면 table에 column을 추가할 수 있습니다. Syntaxalter table table_name add column_name datatype 위처럼 원하는 table_name에 datatype을 가진 column_name을 추가할 수 있습니다. alter table test_schema.test_tableadd price bigint; test_schema.test_tabe이라는 table에datatype이 bigint인 price라는 column을 추가한다.라는 의미입니다.