[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-17 (世界標準時間)。"],[[["\u003cp\u003eThis document provides an overview of the differences between Apache Hive and BigQuery, highlighting key considerations for migrating from Hive to BigQuery.\u003c/p\u003e\n"],["\u003cp\u003eBigQuery offers features such as high availability (>= 99.99% monthly uptime), managed storage in Capacitor format, and reliable cross-data center replication, which may differ from a given Hive implementation.\u003c/p\u003e\n"],["\u003cp\u003eWhile most Hive data types map directly to BigQuery data types, there are a few exceptions like \u003ccode\u003eMAP\u003c/code\u003e and \u003ccode\u003eUNION\u003c/code\u003e, and BigQuery's SQL translator often adds explicit casts due to differences in implicit type handling.\u003c/p\u003e\n"],["\u003cp\u003eBigQuery supports SQL or Javascript for User Defined Functions (UDFs) and recommends converting Hive UDFs to SQL UDFs for better performance, while not supporting User-Defined Aggregation Functions.\u003c/p\u003e\n"],["\u003cp\u003eBigQuery uses Identity and Access Management (IAM) to control data access, with options for row-level, and column-level security, authorized views, and datasets, while Hive uses role-based access control (RBAC) and relies on additional tools like Apache Ranger and Sentry for comprehensive data security.\u003c/p\u003e\n"]]],[],null,["# Apache Hive to BigQuery migration: Overview\n===========================================\n\nThis document compares the differences between Apache Hive and\nBigQuery and discusses key considerations for migration. For\nmore information about how to complete the migration, see the [Apache Hive\nmigration guide](/bigquery/docs/migration/hive).\n\nYou can also use\n[batch SQL translation](/bigquery/docs/batch-sql-translator)\nto migrate your SQL scripts in bulk, or\n[interactive SQL translation](/bigquery/docs/interactive-sql-translator)\nto translate ad hoc queries. Apache HiveQL is fully supported by both\nSQL translation services.\n\nFeatures\n--------\n\nHive and BigQuery are both distributed data\nwarehouse systems. The following table compares some of their high level\nfeatures:\n\nData types\n----------\n\nApache Hive and BigQuery have different data type systems. In\nmost cases, data types in Hive can be mapped to [BigQuery data\ntypes](/bigquery/docs/reference/standard-sql/data-types) with few\nexceptions, such as `MAP` and `UNION`. Apache Hive performs more implicit type\ncasting than BigQuery. As a result, the batch SQL translator\ninserts many explicit casts.\n\nUser defined functions\n----------------------\n\nApache Hive supports writing user defined functions (UDFs) in Java.\nYou can load UDFs into Hive to be used in regular queries.\n[BigQuery UDFs](/bigquery/docs/user-defined-functions)\nmust be written in GoogleSQL or JavaScript. Converting the Hive UDFs\nto SQL UDFs is recommended because SQL UDFs perform\nbetter. If you need to use JavaScript, read\n[Best Practices for JavaScript UDFs](/bigquery/docs/user-defined-functions#best-practices-for-javascript-udfs).\nFor other languages, BigQuery supports\n[remote functions](/bigquery/docs/remote-functions)\nthat let you invoke your functions in\n[Cloud Run functions](/functions/docs/concepts/overview) or\n[Cloud Run](/run/docs/overview/what-is-cloud-run) from\nGoogleSQL queries.\n\nBigQuery does not support user-defined aggregation functions\n(UDAFs).\n\nSecurity\n--------\n\nHive and BigQuery have different security models which are\ndescribed in the following sections:\n\n### Hive access control\n\nFor authorization purpose, Hive introduced\n[SQL Standards Based Authorization](https://cwiki.apache.org/confluence/display/Hive/SQL+Standard+Based+Hive+Authorization)\n(introduced in Hive 0.13.0) to enable fine-grained access control.\nIt uses role-based access control (RBAC) to manage authorization for a large set\nof users and data objects in a typical enterprise environment. This security\nmechanism is based on the Hadoop identities. Hadoop relies\non Kerberos to authenticate identities.\n\n### Secure with Apache Sentry and Apache Ranger\n\n[Apache Ranger](http://ranger.apache.org/) and\n[Apache Sentry](https://sentry.apache.org/)\nare Apache projects that use plugins provided by Hive to implement\nauthorization. Configuring Hive RBAC does not fully secure data, because Hive\ndata is typically stored on HDFS where a user can directly reach data that they\nshould not see. Ranger and Sentry also enforce data on HDFS with POSIX ACLs\ntranslated from the RBAC settings from Hive.\n\n### BigQuery security\n\nBigQuery uses [Identity and Access Management](/bigquery/docs/access-control)\nto control access to data under\na project. You can restrict access to BigQuery datasets.\nTables and views are child resources of datasets and their permissions are\ninherited from datasets. You can assign\n[row-level](/bigquery/docs/row-level-security-intro) and\n[column-level](/bigquery/docs/column-level-security-intro) security to\nindividual tables.\n\nYou can also restrict access by using\n[Authorized views](/bigquery/docs/authorized-views)\nand [Authorized datasets](/bigquery/docs/authorized-datasets).\n\nBigQuery encrypts data by default. To manage your own encryption\nkeys, you can use\n[Cloud KMS with BigQuery](/bigquery/docs/customer-managed-encryption).\n\nWhat's next\n-----------\n\n- Get step-by-step instructions to\n [Migrate schema and data from Apache Hive](/bigquery/docs/migration/hive).\n\n- Reference the\n [Apache Hive SQL translation guide](/bigquery/docs/migration/hive-sql)."]]