일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- c#
- Github
- gas
- PySpark
- math
- Google Spreadsheet
- Excel
- Tkinter
- Apache
- string
- list
- GIT
- Java
- Kotlin
- google apps script
- hive
- Redshift
- Google Excel
- Python
- Mac
- SQL
- matplotlib
- 파이썬
- django
- dataframe
- PANDAS
- PostgreSQL
- numpy
- array
- Today
- Total
목록concat (6)
달나라 노트
Hive에서 concat() 함수는 여러 문자열을 하나로 이어주는 역할을 합니다. Syntax concat(str1, str2, str3, ...) concat() 함수는 여러 개의 parameter를 받을 수 있습니다. 그리고 string type parameter를 모두 연결해서 str1str2str3... 의 string을 return합니다. select concat('abcde, '_', '@', 'xyz', '123', '%') ; -- Result abcde_@xyz% 위처럼 모든 문자열을 연결해줍니다. select concat('_', cast(123 as string), 'abc') ; -- Result _123abc concat() 함수에 들어가는 모든 parameter는 string t..
문자열을 연결하는 방법은 크게 2가지가 있습니다. concat method를 사용하는 것과, + 연산자를 사용하는 것. Syntax String.concat(text1, text2, ...) concat method는 위처럼 어떠한 문자열(String)에 적용할 수 있습니다. 그리고 parameter로서 연결할 문자들을 원하는 만큼 전달하면 됩니다. text1 + text2 + text3 + ... +연산자를 이용하여 텍스트를 연결할 때에는 위처럼 그냥 + 연산자로 모두 더해주면 됩니다. 예시를 살펴봅시다. function myFunction(){ var text1 = 'Apple'; var text2 = 'Banana'; var text3 = 'Peach'; var text4 = 'Melon'; var..
문자열의 연결은 + 연산자를 이용해서 할 수 있습니다. using System; class MyProgram { static void Main() { string test1 = "Apple"; string test2 = "Banana"; string new_string = test1 + test2; Console.WriteLine(new_string); } } -- Result AppleBanana using System; class MyProgram { static void Main() { string test1 = "Apple"; string test2 = "Banana"; string test3 = "Watermelon"; string new_string = string.Concat(test1, t..
Hive에선 collect_list, collect_set이라는 함수를 제공합니다. 이는 여러 행의 데이터를 합칠 때 사용합니다. 마치 Redshift의 listagg와 비슷한 함수라고 생각하면 되겠네요. Table name = employees department_no join_dt name 10 2020-02-01 Bero 10 2020-02-02 Alice 10 2020-02-03 Alice 20 2020-02-03 Dave 20 2020-02-02 Hella 20 2020-02-04 Alice 30 2020-02-06 Grace 30 2020-02-04 Irene 30 2020-02-05 Hella 위와 같은 table이 있다고 가정해봅시다. selectdepartment_no , collect_..