IBM Netezza SQL translation guide
IBM Netezza data warehousing is designed to work with Netezza-specific SQLsyntax. Netezza SQL is based on Postgres 7.2. SQL scripts written for Netezzacan't be used in a BigQuery data warehouse without alterations,because the SQL dialects vary.
This document details the similarities and differences in SQL syntax betweenNetezza and BigQuery in the following areas:
- Data types
- SQL language elements
- Query syntax
- Data manipulation language (DML)
- Data definition language (DDL)
- Stored procedures
- Functions
You can also usebatch SQL translationto migrate your SQL scripts in bulk, orinteractive SQL translationto translate ad-hoc queries. IBM Netezza SQL/NZPLSQL is supported by bothtools inpreview.
Data types
| Netezza | BigQuery | Notes |
|---|---|---|
INTEGER/INT/INT4 | INT64 | |
SMALLINT/INT2 | INT64 | |
BYTEINT/INT1 | INT64 | |
BIGINT/INT8 | INT64 | |
DECIMAL | NUMERIC | TheDECIMAL data typein Netezza is analias for theNUMERICdata type. |
NUMERIC] | NUMERICINT64 | |
NUMERIC(p,s) | NUMERIC | TheNUMERIC type inBigQuery does notenforce custom digit orscale bounds(constraints) likeNetezza does. BigQueryhas fixed 9 digitsafter the decimal,while Netezza allows acustom setup. InNetezza, precisionpcan range from 1 to 38,and scales from 0 tothe precision. |
FLOAT(p) | FLOAT64 | |
REAL/FLOAT(6) | FLOAT64 | |
DOUBLE PRECISION/FLOAT(14) | FLOAT64 | |
CHAR/CHARACTER | STRING | TheSTRING type inBigQuery isvariable-length anddoes not requiremanually setting a maxcharacter length as theNetezzaCHARACTER andVARCHAR typesrequire. The defaultvalue ofn inCHAR(n)is 1. The maximumcharacter string sizeis 64,000. |
VARCHAR | STRING | TheSTRING type inBigQuery isvariable-length anddoes not requiremanually setting a maxcharacter length as theNetezzaCHARACTER andVARCHAR typesrequire. The maximumcharacter string sizeis 64,000. |
NCHAR | STRING | TheSTRING type inBigQuery is stored asvariable length UTF-8encoded Unicode. Themaximum length is16,000 characters. |
NVARCHAR | STRING | TheSTRING type inBigQuery is stored asvariable-lengthUTF-8-encoded Unicode.The maximum length is16,000 characters. |
VARBINARY | BYTES | |
ST_GEOMETRY | GEOGRAPHY | |
BOOLEAN/BOOL | BOOL | TheBOOL type inBigQuery can onlyacceptTRUE/FALSE,unlike theBOOL typein Netezza, which canaccept a variety ofvalues like0/1,yes/no,true/false,on/off. |
DATE | DATE | |
TIME | TIME | |
TIMETZ/TIME WITH TIME ZONE | TIME | Netezza stores theTIME data type in UTCand lets you passan offset from UTCusing theWITH TIMEZONE syntax. TheTIME data type inBigQuery represents atime that's independentof any date or timezone. |
TIMESTAMP | DATETIME | The NetezzaTIMESTAMPtype does not include atime zone, the same asthe BigQueryDATETIME type. |
ARRAY | There is no array datatype in Netezza. Thearray type is insteadstored in a varcharfield. |
Timestamp and date type formatting
When you convert date type formatting elements from Netezza toGoogleSQL, you must pay particular attention to time zonedifferences betweenTIMESTAMP andDATETIME, as summarized in thefollowing table:
| Netezza | BigQuery |
|---|---|
CURRENT_TIMESTAMPCURRENT_TIMETIME informationin Netezza can havedifferent time zoneinformation, whichis defined usingtheWITH TIME ZONE syntax. | If possible, use theCURRENT_TIMESTAMP function,which is formattedcorrectly. However,the output formatdoes not always show theUTC time zone(internally,BigQuery does nothave a time zone).TheDATETIME object in thebq command-line tool andGoogle Cloud console isformatted using aT separatoraccording to RFC3339. However, inPython and JavaJDBC, a space isused as a separator.Use the explicitFORMAT_DATETIME functionto define the dateformat correctly.Otherwise, anexplicit cast ismade to a string,for example:CAST(CURRENT_DATETIME() AS STRING)This also returns aspace separator. |
CURRENT_DATE | CURRENT_DATE |
CURRENT_DATE-3 | BigQuery does notsupport arithmeticdata operations.Instead, use theDATE_ADD function. |
SELECT statement
Generally, the NetezzaSELECT statement is compatible withBigQuery. The following table contains a list of exceptions:
| Netezza | BigQuery |
|---|---|
ASELECT statement withoutFROM clause | Supports special case such as the following:
|
SELECT (subquery) AS flag, CASE WHEN flag = 1 THEN ... | In BigQuery, columns cannot reference the output of other columns defined within the same query. You must duplicate the logic or move the logic into a nested query. Option 1 SELECT (subquery) AS flag, CASE WHEN (subquery) = 1 THEN ... Option 2 SELECT q.*, CASE WHEN flag = 1 THEN ...FROM ( SELECT (subquery) AS flag, ... ) AS q |
Comparison operators
| Netezza | BigQuery | Description |
|---|---|---|
exp = exp2 | exp = exp2 | Equal |
exp <= exp2 | exp <= exp2 | Less than or equal to |
exp < exp2 | exp < exp2 | Less than |
exp <> exp2exp != exp2 | exp <> exp2exp != exp2 | Not equal |
exp >= exp2 | exp >= exp2 | Greater than or equalto |
exp > exp2 | exp > exp2 | Greater than |
Built-in SQL functions
| Netezza | BigQuery | Description |
|---|---|---|
CURRENT_DATE | CURRENT_DATE | Get the current date(year, month, andday). |
CURRENT_TIME | CURRENT_TIME | Get the current timewith fraction. |
CURRENT_TIMESTAMP | CURRENT_TIMESTAMP | Get the currentsystem date and time, to thenearest full second. |
NOW | CURRENT_TIMESTAMP | Get the current systemdate and time, to thenearest full second. |
COALESCE(exp, 0) | COALESCE(exp, 0) | ReplaceNULL withzero. |
NVL(exp, 0) | IFNULL(exp, 0) | ReplaceNULL withzero. |
EXTRACT(DOY FROMtimestamp_expression) | EXTRACT(DAYOFYEAR FROMtimestamp_expression) | Return the number ofdays from thebeginning of the year. |
ADD_MONTHS(date_expr,num_expr) | DATE_ADD(date,INTERVAL k MONTH) | Add months to a date. |
DURATION_ADD(date,k) | DATE_ADD(date,INTERVAL k DAY) | Perform addition ondates. |
DURATION_SUBTRACT(date,k) | DATE_SUB(date,INTERVAL k DAY) | Perform subtraction ondates. |
str1 || str2 | CONCAT(str1,str2) | Concatenate strings. |
Functions
This section compares Netezza and BigQuery functions.
Aggregate functions
| Netezza | BigQuery |
|---|---|
ANY_VALUE | |
APPROX_COUNT_DISTINCT | |
APPROX_QUANTILES | |
APPROX_TOP_COUNT | |
APPROX_TOP_SUM | |
AVG | AVG |
intNand | BIT_AND |
intNnot | Bitwise not operator:~ |
intNor | BIT_OR |
intNxor | BIT_XOR |
intNshl | |
intNshr | |
CORR | CORR |
COUNT | COUNT |
COUNTIF | |
COVAR_POP | COVAR_POP |
COVAR_SAMP | COVAR_SAMP |
GROUPING | |
LOGICAL_AND | |
LOGICAL_OR | |
MAX | MAX |
MIN | MIN |
MEDIAN | PERCENTILE_CONT(x, 0.5) |
STDDEV_POP | STDDEV_POP |
STDDEV_SAMP | STDDEV_SAMPSTDDEV |
STRING_AGG | |
SUM | SUM |
VAR_POP | VAR_POP |
VAR_SAMP | VAR_SAMPVARIANCE |
Analytical functions
| Netezza | BigQuery |
|---|---|
ANY_VALUE | |
ARRAY_AGG | |
ARRAY_CONCAT | ARRAY_CONCAT_AGG |
ARRAY_COMBINE | |
ARRAY_COUNT | |
ARRAY_SPLIT | |
ARRAY_TYPE | |
AVG | AVG |
intNand | BIT_AND |
intNnot | Bitwise not operator:~ |
intNor | BIT_OR |
intNxor | BIT_XOR |
intNshl | |
intNshr | |
CORR | CORR |
COUNT | COUNT |
COUNTIF | |
COVAR_POP | COVAR_POP |
COVAR_SAMP | COVAR_SAMP |
CUME_DIST | CUME_DIST |
DENSE_RANK | DENSE_RANK |
FIRST_VALUE | FIRST_VALUE |
LAG | LAG |
LAST_VALUE | LAST_VALUE |
LEAD | LEAD |
AND | LOGICAL_AND |
OR | LOGICAL_OR |
MAX | MAX |
MIN | MIN |
NTH_VALUE | |
NTILE | NTILE |
PERCENT_RANK | PERCENT_RANK |
PERCENTILE_CONT | PERCENTILE_CONT |
PERCENTILE_DISC | PERCENTILE_DISC |
RANK | RANK |
ROW_NUMBER | ROW_NUMBER |
STDDEV | STDDEV |
STDDEV_POP | STDDEV_POP |
STDDEV_SAMP | STDDEV_SAMP |
STRING_AGG | |
SUM | SUM |
VARIANCE | VARIANCE |
VAR_POP | VAR_POP |
VAR_SAMP | VAR_SAMPVARIANCE |
WIDTH_BUCKET |
Date and time functions
| Netezza | BigQuery |
|---|---|
ADD_MONTHS | DATE_ADDTIMESTAMP_ADD |
AGE | |
CURRENT_DATE | CURRENT_DATE |
CURRENT_DATETIME | |
CURRENT_TIME | CURRENT_TIME |
CURRENT_TIME(p) | |
CURRENT_TIMESTAMP | CURRENT_TIMESTAMP |
CURRENT_TIMESTAMP(p) | |
DATE | |
DATE_ADD | |
DATE_DIFF | |
DATE_FROM_UNIX_DATE | |
DATE_SUB | |
DATE_TRUNC | DATE_TRUNC |
DATE_PART | |
DATETIME | |
DATETIME_ADD | |
DATETIME_DIFF | |
DATETIME_SUB | |
DATETIME_TRUNC | |
DURATION_ADD | |
DURATION_SUBTRACT | |
EXTRACT | EXTRACT (DATE)EXTRACT (TIMESTAMP) |
FORMAT_DATE | |
FORMAT_DATETIME | |
FORMAT_TIME | |
FORMAT_TIMESTAMP | |
LAST_DAY | DATE_SUB(DATE_TRUNC(DATE_ADD(date_expression, INTERVAL 1 MONTH ), MONTH ),INTERVAL 1 DAY ) |
MONTHS_BETWEEN | DATE_DIFF(date_expression,date_expression, MONTH) |
NEXT_DAY | |
NOW | |
OVERLAPS | |
PARSE_DATE | |
PARSE_DATETIME | |
PARSE_TIME | |
PARSE_TIMESTAMP | |
STRING | |
TIME | |
TIME_ADD | |
TIME_DIFF | |
TIME_SUB | |
TIME_TRUNC | |
TIMEOFDAY | |
TIMESTAMP | DATETIME |
TIMESTAMP_ADD | |
TIMESTAMP_DIFF | |
TIMESTAMP_MICROS | |
TIMESTAMP_MILLIS | |
TIMESTAMP_SECONDS | |
TIMESTAMP_SUB | |
TIMESTAMP_TRUNC | |
TIMEZONE | |
TO_DATE | PARSE_DATE |
TO_TIMESTAMP | PARSE_TIMESTAMP |
UNIX_DATE | |
UNIX_MICROS | |
UNIX_MILLIS | |
UNIX_SECONDS |
String functions
| Netezza | BigQuery |
|---|---|
ASCII | TO_CODE_POINTS(string_expr)[OFFSET(0)] |
BYTE_LENGTH | |
TO_HEX | |
CHAR_LENGTH | |
CHARACTER_LENGTH | |
CODE_POINTS_TO_BYTES | |
BTRIM | |
CHR | CODE_POINTS_TO_STRING([numeric_expr]) |
CONCAT | |
DBL_MP | |
DLE_DST | |
ENDS_WITH | |
FORMAT | |
FROM_BASE32 | |
FROM_BASE64 | |
FROM_HEX | |
HEX_TO_BINARY | |
HEX_TO_GEOMETRY | |
INITCAP | |
INSTR | |
INT_TO_STRING | |
LE_DST | |
LENGTH | LENGTH |
LOWER | LOWER |
LPAD | LPAD |
LTRIM | LTRIM |
NORMALIZE | |
NORMALIZE_AND_CASEFOLD | |
PRI_MP | |
REGEXP_CONTAINS | |
REGEXP_EXTRACT | REGEXP_EXTRACT |
REGEXP_EXTRACT_ALL | REGEXP_EXTRACT_ALL |
REGEXP_EXTRACT_ALL_SP | |
REGEXP_EXTRACT_SP | |
REGEXP_INSTR | STRPOS(col,REGEXP_EXTRACT()) |
REGEXP_LIKE | |
REGEXP_MATCH_COUNT | |
REGEXP_REPLACE | REGEXP_REPLACE |
REGEXP_REPLACE_SP | IF(REGEXP_CONTAINS,1,0) |
REGEXP_EXTRACT | |
REPEAT | REPEAT |
REPLACE | |
REVERSE | |
RPAD | RPAD |
RTRIM | RTRIM |
SAFE_CONVERT_BYTES_TO_STRING | |
SCORE_MP | |
SEC_MP | |
SOUNDEX | |
SPLIT | |
STARTS_WITH | |
STRING_TO_INT | |
STRPOS | STRPOS |
SUBSTR | SUBSTR |
TO_BASE32 | |
TO_BASE64 | |
TO_CHAR | |
TO_DATE | |
TO_NUMBER | |
TO_TIMESTAMP | |
TO_CODE_POINTS | |
TO_HEX | |
TRANSLATE | |
TRIM | |
UPPER | UPPER |
UNICODE | |
UNICODES |
Math functions
| Netezza | BigQuery |
|---|---|
ABS | ABS |
ACOS | ACOS |
ACOSH | |
ASIN | ASIN |
ASINH | |
ATAN | ATAN |
ATAN2 | ATAN2 |
ATANH | |
CEILDCEIL | CEIL |
CEILING | |
COS | COS |
COSH | |
COT | COT |
DEGREES | |
DIV | |
EXP | EXP |
FLOORDFLOOR | FLOOR |
GREATEST | GREATEST |
IEEE_DIVIDE | |
IS_INF | |
IS_NAN | |
LEAST | LEAST |
LN | LN |
LOG | LOG |
LOG10 | |
MOD | MOD |
NULLIF(expr, 0) | |
PI | ACOS(-1) |
POWFPOW | POWERPOW |
RADIANS | |
RANDOM | RAND |
ROUND | ROUND |
SAFE_DIVIDE | |
SETSEED | |
SIGN | SIGN |
SIN | SIN |
SINH | |
SQRTNUMERIC_SQRT | SQRT |
TAN | TAN |
TANH | |
TRUNC | TRUNC |
IFNULL(expr, 0) |
DML syntax
This section compares Netezza and BigQuery DML syntax.
INSERT statement
| Netezza | BigQuery |
|---|---|
INSERT INTO table VALUES (...); | INSERT INTO table (...) VALUES (...); Netezza offers a DEFAULT keyword and other constraintsfor columns. In BigQuery, omitting column names in theINSERT statement is valid only if all columns aregiven. |
INSERT INTO table (...) VALUES (...);INSERT INTO table (...) VALUES (...); | INSERT INTO table VALUES (), (); BigQuery imposesDML quotas, which restrict thenumber of DML statements you can execute daily. To make the best useof your quota, consider the following approaches:
|
DML scripts in BigQuery have slightly different consistencysemantics than the equivalent statements in Netezza. Also note thatBigQuery does not offer constraints apart fromNOTNULL.
For an overview of snapshot isolation and session and transaction handling, seeConsistency guarantees and transaction isolation.
UPDATE statement
In Netezza, theWHERE clause is optional, but in BigQuery it isnecessary.
| Netezza | BigQuery |
|---|---|
UPDATE tblSETtbl.col1=val1; | Not supported without theWHERE clause. Use aWHERE true clause to update all rows. |
UPDATE ASET y = B.y, z = B.z + 1FROM BWHERE A.x = B.x AND A.y IS NULL; | UPDATE ASET y = B.y, z = B.z + 1FROM BWHERE A.x = B.x AND A.y IS NULL; |
UPDATE A aliasSET x = x + 1WHERE f(x) IN (0, 1) | UPDATE ASET x = x + 1WHERE f(x) IN (0, 1); |
UPDATE ASET z = B.zFROM BWHERE A.x = B.x AND A.y = B.y | UPDATE ASET z = B.zFROM BWHERE A.x = B.x AND A.y = B.y; |
For examples, seeUPDATE examples.
Because ofDML quotas,we recommend that you use largerMERGE statements instead of multiple singleUPDATE andINSERT statements. DML scripts in BigQuery haveslightly different consistency semantics than equivalent statements in Netezza.For an overview of snapshot isolation and session and transaction handling, seeConsistency guarantees and transaction isolation.
DELETE andTRUNCATE statements
TheDELETE andTRUNCATE statements are both ways to remove rows from a tablewithout affecting the table schema or indexes. TheTRUNCATE statement has thesame effect as theDELETE statement, but is much faster than theDELETEstatement for large tables. TheTRUNCATE statement is supported in Netezza butnot supported in BigQuery. However, you can useDELETEstatements in both Netezza and BigQuery.
In BigQuery, theDELETE statement must have aWHERE clause.In Netezza, theWHERE clause is optional. If theWHERE clause is notspecified, all the rows in the Netezza table are deleted.
| Netezza | BigQuery | Description |
|---|---|---|
BEGIN;LOCK TABLE A IN EXCLUSIVE MODE;DELETE FROM A;INSERT INTO A SELECT * FROM B;COMMIT; | Replacing the contents of a table with query output is the equivalent of a transaction. You can do this with either aqueryor acopy (cp)operation.bq query \ bq cp \ | Replace the contents of a table with the results of a query. |
DELETE FROM database.table | DELETE FROM table WHERE TRUE; | In Netezza, when a delete statement is run, the rows are not deleted physically but only marked for deletion. Running theGROOM TABLE ornzreclaim commands later removes the rows marked for deletion and reclaims the corresponding disk space. |
GROOMTABLE | Netezza uses theGROOM TABLE command to reclaim disk space by removing rows marked for deletion. |
MERGE statement
AMERGE statement must match at most one source row for each target row. DMLscripts in BigQuery have slightly different consistency semanticsthan the equivalent statements in Netezza. For an overview of snapshot isolationand session and transaction handling, seeConsistency guarantees and transaction isolation.For examples, seeBigQueryMERGE examplesandNetezzaMERGE examples.
DDL syntax
This section compares Netezza and BigQuery DDL syntax.
CREATE TABLE statement
| Netezza | BigQuery | Description |
|---|---|---|
TEMPTEMPORARY | With BigQuery's DDLsupport, you cancreate a table fromthe results of a queryand specify itsexpiration at creationtime. For example, forthree days:CREATE TABLE'my-project.public_dump.vtemp'OPTIONS(expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(),INTERVAL 3 DAY)) | Create tablestemporary to asession. |
ZONE MAPS | Not supported. | Quick search forWHERE condition. |
DISTRIBUTE ON | PARTITION BY | Partitioning.This is not a direct translation.DISTRIBUTE ON shares databetween nodes, usually with a unique key for even distribution,whilePARTITION BY prunes data into segments. |
ORGANIZE ON | CLUSTER BY | Both Netezzaand BigQuery supportup to four keys forclustering. Netezzaclustered base tables(CBT) provide equalprecedence to each ofthe clusteringcolumns. BigQuerygives precedence tothe first column onwhich the table isclustered, followed bythe second column, andso on. |
ROW SECURITY | Authorized View | Row-level security. |
CONSTRAINT | Not supported | Check constraints. |
DROP statement
| Netezza | BigQuery | Description |
|---|---|---|
DROP TABLE | DROP TABLE | |
DROP DATABASE | DROP DATABASE | |
DROP VIEW | DROP VIEW |
Column options and attributes
| Netezza | BigQuery | Description |
|---|---|---|
NULLNOT NULL | NULLABLEREQUIRED | Specify if the column isallowed to containNULL values. |
REFERENCES | Not supported | Specify columnconstraint. |
UNIQUE | Not supported | Each value in the columnmust be unique. |
DEFAULT | Not supported | Default value for allvalues in the column. |
Temporary tables
Netezza supportsTEMPORARY tablesthat exist during the duration of a session.
To build a temporary table in BigQuery, do the following:
- Create a dataset that has a short time to live (for example, 12 hours).
Create the temporary table in the dataset, with a table name prefix of
temp. For example, to create a table that expires in one hour, do this:CREATETABLEtemp.name(col1,col2,...)OPTIONS(expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(),INTERVAL1HOUR));
Start reading and writing from the temporary table.
You can alsoremove duplicates independentlyin order to find errors in downstream systems.
Note that BigQuery does not supportDEFAULT andIDENTITY(sequences) columns.
Procedural SQL statements
Netezza uses theNZPLSQLscripting language to work with stored procedures. NZPLSQL is based on Postgres'PL/pgSQL language. This section describes how to convert procedural SQLstatements used in stored procedures, functions, and triggers from Netezza toBigQuery.
CREATE PROCEDURE statement
Netezza and BigQuery both support creating stored proceduresby using theCREATE PROCEDUREstatement. For more information, seeWork with SQL stored procedures.
Variable declaration and assignment
| Netezza | BigQuery | Description |
|---|---|---|
DECLARE vardatatype(len) [DEFAULTvalue]; | DECLARE | Declare variable. |
SET var = value; | SET | Assign value to variable. |
Exception handlers
Netezza supports exception handlers that can be triggered for certain errorconditions. BigQuery does not support condition handlers.
| Netezza | BigQuery | Description |
|---|---|---|
EXCEPTION | Not supported | Declare SQL exception handler forgeneral errors. |
Dynamic SQL statements
Netezza supports dynamic SQL queries inside stored procedures.BigQuery does not support dynamic SQL statements.
| Netezza | BigQuery | Description |
|---|---|---|
EXECUTE IMMEDIATEsql_str; | EXECUTE IMMEDIATEsql_str; | Execute dynamic SQL. |
Flow-of-control statements
| Netezza | BigQuery | Description |
|---|---|---|
IF THEN ELSE STATEMENTIFconditionTHEN ...ELSE ...END IF; | IFconditionTHEN ...ELSE ...END IF; | Executeconditionally. |
Iterative ControlFOR var AS SELECT ...DOstmtsEND FOR;FOR var AS cur CURSORFOR SELECT ...DO stmts END FOR; | Not supported | Iterate over a collectionof rows. |
Iterative ControlLOOP stmts END LOOP; | LOOPsql_statement_list END LOOP; | Loop block of statements. |
EXIT WHEN | BREAK | Exit a procedure. |
WHILE *condition* LOOP | WHILEconditionDO ...END WHILE | Execute a loop ofstatements until a whilecondition fails. |
Other statements and procedural language elements
| Netezza | BigQuery | Description |
|---|---|---|
CALLproc(param,...) | Not supported | Execute a procedure. |
EXECproc(param,...) | Not supported | Execute a procedure. |
EXECUTEproc(param,...) | Not supported | Execute a procedure. |
Multi-statement and multi-line SQL statements
Both Netezza and BigQuery support transactions (sessions) andtherefore support statements separated by semicolons that are consistentlyexecuted together. For more information, seeMulti-statement transactions.
Other SQL statements
| Netezza | BigQuery | Description |
|---|---|---|
GENERATESTATISTICS | Generate statisticsfor all the tables inthe current database. | |
GENERATESTATISTICS ONtable_name | Generate statisticsfor a specific table. | |
GENERATESTATISTICS ONtable_name(col1,col4) | Either usestatistical functionslikeMIN, MAX, AVG,etc., use the UI, oruse the Cloud Data Loss Prevention API. | Generate statisticsfor specific columnsin a table. |
GENERATESTATISTICS ONtable_name | APPROX_COUNT_DISTINCT(col) | Show the number ofunique values forcolumns. |
INSERT INTOtable_name | INSERT INTOtable_name | Insert a row. |
LOCK TABLEtable_name FOREXCLUSIVE; | Not supported | Lock row. |
SET SESSIONCHARACTERISTICS ASTRANSACTION ISOLATIONLEVEL ... | BigQuery always usesSnapshot Isolation.For details, seeConsistencyguarantees andtransactionisolation. | Define the transactionisolation level. |
BEGIN TRANSACTIONEND TRANSACTIONCOMMIT | BigQuery always usesSnapshot Isolation.For details, seeConsistencyguarantees andtransactionisolation. | Define thetransaction boundary formulti-statementrequests. |
EXPLAIN ... | Not supported. Similarfeatures in thequeryplan and timeline | Show query plan for aSELECT statement. |
| User Viewsmetadata System Views metadata | SELECT* EXCEPT(is_typed)FROMmydataset.INFORMATION_SCHEMA.TABLES;BigQueryInformation Schema | Query objects in thedatabase |
Consistency guarantees and transaction isolation
Both Netezza and BigQuery are atomic, that is,ACID compliant ona per-mutation level across many rows. For example, aMERGE operation iscompletely atomic, even with multiple inserted values.
Transactions
Netezza syntactically accepts all four modes of ANSI SQLtransaction isolation.However, regardless of what mode is specified, only theSERIALIZABLE mode isused, which provides the highest possible level of consistency. This mode alsoavoids dirty, non repeatable, and phantom reads between concurrent transactions.Netezza does not use conventionallockingto enforce consistency. Instead, it usesserialization dependency checking,a form of optimistic concurrency control to automatically roll back the latesttransaction when two transactions attempt to modify the same data.
BigQuery alsosupports transactions.BigQuery helps ensure optimistic concurrency control (first tocommit has priority) with snapshot isolation, in which a query reads the lastcommitted data before the query starts. This approach ensures the same levelof consistency on a per-row, per-mutation basis and across rows within the sameDML statement, yet avoids deadlocks. In the case of multiple DML updates againstthe same table, BigQuery switches topessimistic concurrency control.Load jobs can run completely independently and append to tables.
Rollback
Netezza supports theROLLBACK TRANSACTION statementto abort the current transaction and rollback all the changes made in thetransaction.
In BigQuery, you can use theROLLBACK TRANSACTION statement.
Database limits
| Limit | Netezza | BigQuery |
|---|---|---|
| Tables per database | 32,000 | Unrestricted |
| Columns per table | 1600 | 10000 |
| Maximum row size | 64 KB | 100 MB |
| Column and tablename length | 128 bytes | 16,384 Unicodecharacters |
| Rows per table | Unlimited | Unlimited |
| Maximum SQL requestlength | 1 MB (maximumunresolved standardSQL query length). 12 MB (maximum resolvedlegacy and standardSQL query length). Streaming: 10 MB (HTTP request sizelimit) 10,000 (maximum rows per request) | |
| Maximum request andresponse size | 10 MB (request) and 10 GB(response) orvirtually unlimited ifusing pagination orthe Cloud Storage API. | |
| Maximum number ofconcurrent sessions | 63 concurrentread-writetransactions. 2000concurrent connectionsto the server. | 100 concurrent queries(can be raised withslot reservation),300 concurrent APIrequests per user. |
What's next
- Get step-by-step instructions toMigrate from IBM Netezza to BigQuery.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.