Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cartodbfy shall discard cartodb_id candidates that contain nulls #148

Closed
rafatower opened this issue Sep 11, 2015 · 4 comments
Closed

cartodbfy shall discard cartodb_id candidates that contain nulls #148

rafatower opened this issue Sep 11, 2015 · 4 comments

Comments

@rafatower
Copy link
Contributor

Currently it checks for uniqueness but not for nullity.

@iriberri
Copy link
Contributor

Just forced this behaviour by importing a file in which I nulled some cdb_ids in the testing environment, and yes, the error is there:

ERROR: CDB(_CDB_Add_Indexes:23502:column "cartodb_id" contains null values): ALTER TABLE untitled_table_2_merge_1 ADD PRIMARY KEY (cartodb_id)\nCONTEXT: SQL statement "SELECT _CDB_SQL(sql, '_CDB_Add_Indexes')

(Probably this comment is useless for the record, but this way I make sure I report everything I'm facing...)

@rafatower
Copy link
Contributor Author

Example csv file from iriberri:

cartodb_id,the_geom,untitled_table_1_name,untitled_table_1_city,name,column_1441980553921,city
1,0101000020E610000074D2FBC6D79E0DC05A643BDF4F354440,,Madrid,,,Madrid
2,0101000020E6100000739D465A2A6FE6BF28D53E1D8F214340,,Elche,,,Elche
,,,,,,

@iriberri
Copy link
Contributor

iriberri commented Oct 2, 2015

https://cartodb.com/superadmin/users/11903/data_imports/09a4ba10-1572-4f47-99f2-a2744def0206

From today:

2015-10-02 13:03:32 UTC: Exception: PG::Error: ERROR:  CDB(_CDB_Add_Indexes:23502:column "cartodb_id" contains null values): ALTER TABLE download ADD PRIMARY KEY (cartodb_id)
CONTEXT:  SQL statement "SELECT _CDB_SQL(sql, '_CDB_Add_Indexes')"
PL/pgSQL function _cdb_add_indexes(regc

@rafatower
Copy link
Contributor Author

fix is ready, to be deployed beginning of next week.

rafatower pushed a commit that referenced this issue Oct 6, 2015
- Added CDB_DateToNumber(timestamp with time zone) [#169](#169)
- cartodbfy now discards cartodb_id candidates that contain nulls [#148](#148)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants