This is an automated email from the ASF dual-hosted git repository. riyer pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/madlib.git
The following commit(s) were added to refs/heads/master by this push: new 7c3c1a3 Encode categorical: Add BIGINT as valid categorical type 7c3c1a3 is described below commit 7c3c1a35ab921f2401df4684ab6d48a14fa51b2d Author: Rahul Iyer <ri...@apache.org> AuthorDate: Fri Jan 18 14:52:28 2019 -0800 Encode categorical: Add BIGINT as valid categorical type JIRA: MADLIB-1295 --- src/ports/postgres/modules/utilities/encode_categorical.py_in | 2 +- src/ports/postgres/modules/utilities/test/encode_categorical.sql_in | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ports/postgres/modules/utilities/encode_categorical.py_in b/src/ports/postgres/modules/utilities/encode_categorical.py_in index cd08012..8695a73 100644 --- a/src/ports/postgres/modules/utilities/encode_categorical.py_in +++ b/src/ports/postgres/modules/utilities/encode_categorical.py_in @@ -396,7 +396,7 @@ class CategoricalEncoder(object): self._all_cols_types = get_cols_and_types(self.source_table) # any column belonging to the following types are considered categorical - int_types = ['integer', 'smallint'] + int_types = ['integer', 'smallint', 'bigint'] text_types = ['text', 'varchar', 'character varying', 'char', 'character'] boolean_types = ['boolean'] self._cat_types = set(int_types + text_types + boolean_types) diff --git a/src/ports/postgres/modules/utilities/test/encode_categorical.sql_in b/src/ports/postgres/modules/utilities/test/encode_categorical.sql_in index 7dc6169..f7addc8 100644 --- a/src/ports/postgres/modules/utilities/test/encode_categorical.sql_in +++ b/src/ports/postgres/modules/utilities/test/encode_categorical.sql_in @@ -109,7 +109,7 @@ CREATE TABLE abalone_special_char ( "len$$'%*()gth" double precision, diameter double precision, height double precision, - "ClaЖss" integer + "ClaЖss" bigint ); COPY abalone_special_char ("se$$''x", "len$$'%*()gth", diameter, height, "ClaЖss") FROM stdin WITH DELIMITER '|' NULL as '@'; F"F|0.475|0.37|0.125|2 @@ -121,6 +121,9 @@ M,M|0.47|0.355|0.100|1 'F'F'|0.55|0.44|0.15|0 \. +select encode_categorical_variables('abalone_special_char', 'abalone_special_char_out0', '*'); +select * from abalone_special_char_out0; + select encode_categorical_variables('abalone_special_char', 'abalone_special_char_out1', '"se$$''''x", "len$$''%*()gth"'); select * from abalone_special_char_out1;