2
votes

Is there a "better" way of handling errors while loading data?

For example:

With schema:
ONE:STRING,TWO:INTEGER,THREE:INTEGER

And Data: 
        ABC, 123, 234
        DEF, D, 324
        XYZ, 12334, 423

Is there a way I can load this to a table by ignoring only column TWO and not entire row two? That is result in:

ABC, 123, 234
DEF, NULL, 324
XYZ, 12334, 423

Instead of:

ABC, 123, 234
XYZ, 12334, 423
1

1 Answers

1
votes

What I would do is change column TWO to a string:

TWO:STRING

Then you can query column2 like this:

Select INTEGER(expr) from yourTable;

If value is not an integer then it will return NULL (exactly like you want).