我是大数据的新手,我正在尝试了解持久化和检索数据的各种方法.我知道Parquet和HBase都是面向列的存储格式,但Parquet是面向文件的存储,而不是像HBase那样的数据库.我的问题是:
我有一个通过 Kubernetes pod 运行的 spark 作业。到目前为止,我一直在使用 Yaml 文件手动运行我的作业。现在,我想通过气流安排我的火花作业。这是我第一次使用气流,我无法弄清楚如何在气流中添加我的 Yaml 文件。据我所知,我可以通过 Airflow 中的 DAG 安排我的工作。一个 dag 示例是这样的:
from airflow.operators import PythonOperator
from airflow.models import DAG
from datetime import datetime, timedelta
args = {'owner':'test', 'start_date' : datetime(2019, 4, 3), 'retries': 2, 'retry_delay': timedelta(minutes=1) }
dag = DAG('test_dag', default_args = args, catchup=False)
def print_text1():
print("hell-world1")
def print_text():
print('Hello-World2')
t1 = PythonOperator(task_id='multitask1', python_callable=print_text1, dag=dag)
t2 = PythonOperator(task_id='multitask2', python_callable=print_text, dag=dag)
t1 >> t2
Run Code Online (Sandbox Code Playgroud)
在这种情况下,一旦我播放 DAG,上述方法将依次执行。现在,如果我想运行 spark 提交作业,我该怎么办?我正在使用 Spark 2.4.4
我正在尝试通过 JDBC 驱动程序连接到 DB2 数据库。我在 pom.xml 中添加了以下条目
<!-- https://mvnrepository.com/artifact/com.ibm.db2/db2jcc_license_cu -->
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>db2jcc_license_cu</artifactId>
<version>9.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.ibm.db2/db2jcc -->
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>db2jcc</artifactId>
<version>8.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.ibm.db2.jcc/db2jcc4 -->
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc4</artifactId>
<version>10.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
但是 maven 构建因以下问题而失败
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/ibm/db2/db2jcc_license_cu/9.7/db2jcc_license_cu-9.7.pom
[WARNING] The POM for com.ibm.db2:db2jcc_license_cu:jar:9.7 is missing, no dependency information available
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/ibm/db2/db2jcc/8.1/db2jcc-8.1.pom
[WARNING] The POM for com.ibm.db2:db2jcc:jar:8.1 is missing, no dependency information available
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/ibm/db2/jcc/db2jcc4/10.1/db2jcc4-10.1.pom
[WARNING] The POM for com.ibm.db2.jcc:db2jcc4:jar:10.1 is missing, no dependency …Run Code Online (Sandbox Code Playgroud)