本文整理匯總了Python中airflow.contrib.hooks.sqoop_hook.SqoopHook._get_export_format_argument方法的典型用法代碼示例。如果您正苦於以下問題:Python SqoopHook._get_export_format_argument方法的具體用法?Python SqoopHook._get_export_format_argument怎麽用?Python SqoopHook._get_export_format_argument使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類airflow.contrib.hooks.sqoop_hook.SqoopHook
的用法示例。
在下文中一共展示了SqoopHook._get_export_format_argument方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_get_export_format_argument
# 需要導入模塊: from airflow.contrib.hooks.sqoop_hook import SqoopHook [as 別名]
# 或者: from airflow.contrib.hooks.sqoop_hook.SqoopHook import _get_export_format_argument [as 別名]
def test_get_export_format_argument(self):
hook = SqoopHook()
self.assertIn("--as-avrodatafile",
hook._get_export_format_argument('avro'))
self.assertIn("--as-parquetfile",
hook._get_export_format_argument('parquet'))
self.assertIn("--as-sequencefile",
hook._get_export_format_argument('sequence'))
self.assertIn("--as-textfile",
hook._get_export_format_argument('text'))
with self.assertRaises(AirflowException):
hook._get_export_format_argument('unknown')
示例2: test_get_export_format_argument
# 需要導入模塊: from airflow.contrib.hooks.sqoop_hook import SqoopHook [as 別名]
# 或者: from airflow.contrib.hooks.sqoop_hook.SqoopHook import _get_export_format_argument [as 別名]
def test_get_export_format_argument(self):
"""
Tests to verify the hook get format function is building correct Sqoop command with correct format type.
"""
hook = SqoopHook()
self.assertIn("--as-avrodatafile",
hook._get_export_format_argument('avro'))
self.assertIn("--as-parquetfile",
hook._get_export_format_argument('parquet'))
self.assertIn("--as-sequencefile",
hook._get_export_format_argument('sequence'))
self.assertIn("--as-textfile",
hook._get_export_format_argument('text'))
with self.assertRaises(AirflowException):
hook._get_export_format_argument('unknown')