String lower case in mapd


#1

is there any way to convert a string to lower case?
i also want to know how to extract month,day,date form a date format


#2

Hi @nagulan -

We currently have limited string processing support in MapD, due to how we use dictionary encoding to improve string access performance. So unfortunately, we don’t currently have a way to do make a string lowercase.

For the date functions, you can find all of the supported functions here under ‘Date/Time Function Support’:

https://www.mapd.com/docs/latest/5_dml.html

I suspect you are looking for the extract function.


#3

thank you for your time
but by using extract command we can extract only one value that is either month or year form date if i use this i want to concat both month and year in string format. i dont how to concat too

i want to both year and month from date in string format can you help me


#4

Hi @nagulan,

I’ll let others try to answer your question directly but wanted to note that we have much more extensive string functionality planned, even with dictionary encoded strings.

Regards


#5

i have read about encoded string but i cant understand
what is functionality of encoded string
can you explain me


#6

mapd stores the distincts values of strings dictionary encoded on system ram substituting the column’s values with an integer.

This helps in several ways; the access on GPU/CPU memory is aligned, memory and bandwidth foorprint is greatly reduced (you can see it as a compression) and also helps GPU processing too, because GPUs like to deal with numbers than other types.

Simple scenario with a flat table

you have a table of 1B of records with a columns contaning a column contaning names of towns

Alameda
Alameda
Alameda
Bakersfield
Bakersfield
Alameda
Los Angeles
Alameda
Los Angeles
San Francisco
San Francisco
etc. etc.

the average length is more or less of 9 bytes so the memory/storage footprint of this column would be 85GB, but using a dictionary encoding of 16 bits it’s reduced to 19GB because the column would look like this
1
1
1
2
2
1
3
1
3
4
4
etc.

this translates on more performance (and less hardware costs)


#7

@aznable
thank you fro your time
now i understood


#8

is there any way to use to_char() function in mapd
if so how to use it


#9

there is a CAST funtion but AFAIK it limited to expressions

https://www.mapd.com/docs/latest/5_dml.html

CAST(expr AS type) CAST(1.25 AS FLOAT) Converts an expression to another data type