This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM python:3.7 | |
| WORKDIR /app | |
| # Copy the requirements.txt file and install all dependencies. | |
| COPY requirements.txt . | |
| RUN pip install -r requirements.txt | |
| # Downloading and installing gcloud package. | |
| RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz | |
| RUN mkdir -p /usr/local/gcloud \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| source ./env/bin/activate | |
| pytest --cov --cov-report html --cov-report term-missing | |
| open /Applications/Google\ Chrome.app htmlcov/index.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Login as super user | |
| sudo -s | |
| apt-get install curl | |
| curl -sSL https://get.docker.com/ | sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| βββββββββββββββββββββββββββββββ¦βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β Property β Interface Or Abstract class β | |
| β ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β hive.exec.pre.hooks β org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext β | |
| β hive.exec.post.hooks β org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext β | |
| β hive.exec.failure.hooks β org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext β | |
| β hive.metastore.init.hooks β org.apache.hadoop.hive.metastore.MetaStoreInitListener β | |
| β hive.exec.driver.run.hooks β org.apache.hadoop.hive.ql.HiveDriverRunHook β | |
| β hive.semantic.analyser.hook β org.apache.hadoop.hive.ql.parse.AbstractSemanticAnalyzerHook β | |
| βββββββββββββββββββββββββββββββ©βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| βββββββββββββββββββββββββββββββββββββββββ¦ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β Property β Abstract class β | |
| β ββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β hive.metastore.pre.event.listeners β org.apache.hadoop.hive.metastore.MetaStorePreEventListener β | |
| β hive.metastore.end.function.listeners β org.apache.hadoop.hive.metastore.MetaStoreEndFunctionListener β | |
| β hive.metastore.event.listeners β org.apache.hadoop.hive.metastore.MetaStoreEventListener β | |
| βββββββββββββββββββββββββββββββββββββββββ©ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| βββββββββββββββββββββββββββββββββββββββββββββββββ¦βββββββββββββββββββββββββ | |
| β Method β Parameter β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββ | |
| β MetaStoreEventListener.onConfigChange β ConfigChangeEvent β | |
| β MetaStoreEventListener.onCreateTable β CreateTableEvent β | |
| β MetaStoreEventListener.onDropTable β DropTableEvent β | |
| β MetaStoreEventListener.onAlterTable β AlterTableEvent β | |
| β MetaStoreEventListener.onAddPartition β AddPartitionEvent β | |
| β MetaStoreEventListener.onDropPartition β DropPartitionEvent β | |
| β MetaStoreEventListener.onAlterPartition β AlterPartitionEvent β |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "sample-pubsub", | |
| "version": "0.0.1", | |
| "dependencies": { | |
| "@google-cloud/pubsub": "^0.18.0" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.medium.hive.hook; | |
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import org.apache.hadoop.hive.ql.QueryPlan; | |
| import org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext; | |
| import org.apache.hadoop.hive.ql.hooks.HookContext; | |
| import org.apache.hadoop.hive.ql.hooks.HookContext.HookType; | |
| import org.apache.hadoop.hive.ql.hooks.ReadEntity; | |
| import org.apache.hadoop.hive.ql.hooks.WriteEntity; | |
| import org.apache.hadoop.hive.ql.plan.HiveOperation; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.medium.hive.metastore.listerner; | |
| import org.apache.hadoop.conf.Configuration; | |
| import org.apache.hadoop.hive.metastore.events.AlterTableEvent; | |
| import org.apache.hadoop.hive.metastore.MetaStoreEventListener; | |
| import org.apache.hadoop.hive.metastore.events.CreateTableEvent; | |
| import org.codehaus.jackson.map.ObjectMapper; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| new_metadata = metadata.head(1).copy() | |
| for i in range(100): | |
| row = metadata.head(1) | |
| row['table_name'] = row['table_name'] + str(i) | |
| new_metadata = new_metadata.append(row) | |
| @classmethod | |
| def __get_df_memory_usage(cls, key_value, df): | |
| import io | |
| buf = io.StringIO() |