本文整理汇总了Python中dart.client.python.dart_client.Dart.save_dataset方法的典型用法代码示例。如果您正苦于以下问题:Python Dart.save_dataset方法的具体用法?Python Dart.save_dataset怎么用?Python Dart.save_dataset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dart.client.python.dart_client.Dart
的用法示例。
在下文中一共展示了Dart.save_dataset方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestDatasetCrud
# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import save_dataset [as 别名]
class TestDatasetCrud(unittest.TestCase):
def setUp(self):
self.dart = Dart(host='localhost', port=5000)
def test_crud(self):
columns = [Column('c1', DataType.VARCHAR, 50), Column('c2', DataType.BIGINT)]
df = DataFormat(FileFormat.PARQUET, RowFormat.NONE)
ds = Dataset(
data=DatasetData(name=NoOpActionTypes.action_that_succeeds.name,
table_name=NoOpActionTypes.action_that_succeeds.name,
load_type=LoadType.INSERT,
location='s3://bucket/prefix',
data_format=df,
columns=columns,
tags=['foo']))
ds.data.user_id = '[email protected]'
posted_dataset = self.dart.save_dataset(ds)
self.assertEqual(posted_dataset.data.to_dict(), ds.data.to_dict())
dataset = self.dart.get_dataset(posted_dataset.id)
self.assertEqual(posted_dataset.to_dict(), dataset.to_dict())
dataset.data.compression = Compression.GZIP
put_dataset = self.dart.save_dataset(dataset)
self.assertEqual(put_dataset.data.compression, Compression.GZIP)
self.assertNotEqual(posted_dataset.to_dict(), put_dataset.to_dict())
self.dart.delete_dataset(dataset.id)
try:
self.dart.get_dataset(dataset.id)
except DartRequestException as e:
self.assertEqual(e.response.status_code, 404)
return
self.fail('dataset should have been missing after delete!')
示例2: Column
# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import save_dataset [as 别名]
dataset = dart.save_dataset(Dataset(id='PDUZ8EDNOR', data=(DatasetData(
name='beacon_native_app_parsed_gzipped_v03',
table_name='beacon_native_app',
location='s3://example-bucket/prd/beacon/native_app/v3/dwh-delimited/gzipped',
load_type=LoadType.INSERT,
distribution_keys=['created'],
sort_keys=['created', 'eventtype'],
hive_compatible_partition_folders=True,
data_format=DataFormat(
FileFormat.TEXTFILE,
RowFormat.DELIMITED,
delimited_by='\t',
quoted_by='"',
escaped_by='\\',
null_string='NULL',
),
compression=Compression.GZIP,
partitions=[Column('createdpartition', DataType.STRING)],
columns=[
Column('logfileid', DataType.INT),
Column('linenumber', DataType.INT),
Column('created', DataType.TIMESTAMP, date_pattern="yyyy-MM-dd HH:mm:ss"),
Column('remoteip', DataType.VARCHAR, 500),
Column('useragent', DataType.VARCHAR, 2500),
Column('eventtype', DataType.VARCHAR, 255),
Column('appversion', DataType.VARCHAR, 255),
Column('advertiserid', DataType.VARCHAR, 2048),
Column('couponsonpage', DataType.INT),
Column('coupons', DataType.VARCHAR, 10000),
Column('channel', DataType.VARCHAR, 128),
Column('geocouponcount', DataType.BIGINT),
Column('geofence', DataType.VARCHAR, 255),
Column('geofencetimespent', DataType.NUMERIC, precision=14, scale=5),
Column('loginstatus', DataType.VARCHAR, 25),
Column('products', DataType.VARCHAR, 2500),
Column('session', DataType.VARCHAR, 5000),
Column('systemname', DataType.VARCHAR, 2500),
Column('systemversion', DataType.VARCHAR, 2500),
Column('udid', DataType.VARCHAR, 128),
Column('userqualifier', DataType.VARCHAR, 64),
Column('url', DataType.VARCHAR, 5000),
Column('user_uuid', DataType.VARCHAR, 64),
Column('userid', DataType.INT),
Column('searchtype', DataType.VARCHAR, 128),
Column('searchlistterm', DataType.VARCHAR, 512),
Column('searchterm', DataType.VARCHAR, 512),
Column('emailuuid', DataType.VARCHAR, 128),
Column('userfingerprint', DataType.VARCHAR, 64),
Column('locationstatus', DataType.VARCHAR, 128),
Column('pushnotificationstatus', DataType.VARCHAR, 128),
Column('placement', DataType.VARCHAR, 1024),
Column('loc', DataType.VARCHAR, 128),
Column('ppoi0', DataType.VARCHAR, 128),
Column('ppoi1', DataType.VARCHAR, 128),
Column('ppoi2', DataType.VARCHAR, 128),
Column('ppoi3', DataType.VARCHAR, 128),
Column('ppoi4', DataType.VARCHAR, 128),
Column('applaunchnotificationtype', DataType.VARCHAR, 128),
Column('scenarioname', DataType.VARCHAR, 128),
Column('behaviorname', DataType.VARCHAR, 128),
Column('coupontype', DataType.VARCHAR, 128),
Column('couponposition', DataType.VARCHAR, 128),
Column('hasqsrcontent', DataType.VARCHAR, 128),
Column('promptname', DataType.VARCHAR, 128),
Column('locationpermissionchanage', DataType.VARCHAR, 128),
Column('couponproblemtype', DataType.VARCHAR, 128),
Column('storetitle', DataType.VARCHAR, 128),
Column('mallname', DataType.VARCHAR, 128),
Column('restaurantname', DataType.VARCHAR, 128),
Column('milesaway', DataType.VARCHAR, 128),
Column('menuitem', DataType.VARCHAR, 128),
Column('toolname', DataType.VARCHAR, 128),
Column('toolaction', DataType.VARCHAR, 128),
Column('toolstep', DataType.VARCHAR, 128),
Column('mallposition', DataType.VARCHAR, 128),
Column('recommendstorename', DataType.VARCHAR, 128),
Column('recommendstoreposition', DataType.VARCHAR, 128),
Column('favoritestorename', DataType.VARCHAR, 128),
Column('favoritestoreaction', DataType.VARCHAR, 128),
Column('favoritestoreposition', DataType.VARCHAR, 128),
Column('favoritesiteid', DataType.VARCHAR, 128),
Column('receivername', DataType.VARCHAR, 128),
Column('outclickbuttonprompt', DataType.VARCHAR, 128),
Column('datasource', DataType.VARCHAR, 1024),
Column('searchresultcount', DataType.VARCHAR, 128),
Column('searchresultposition', DataType.VARCHAR, 128),
Column('sharetype', DataType.VARCHAR, 128),
Column('daysuntilexpiration', DataType.VARCHAR, 128),
Column('firedate', DataType.VARCHAR, 128),
Column('settingschangevalue', DataType.VARCHAR, 128),
Column('settingschangetype', DataType.VARCHAR, 128),
Column('settingschangelocation', DataType.VARCHAR, 128),
Column('clickaction', DataType.VARCHAR, 128),
Column('tnt', DataType.VARCHAR, 128),
Column('previouspage', DataType.VARCHAR, 2500),
Column('clickpage', DataType.VARCHAR, 2500),
Column('launchreason', DataType.VARCHAR, 128),
Column('taplyticsData', DataType.VARCHAR, 150),
Column('appCampaign', DataType.VARCHAR, 50),
Column('accountMethod', DataType.VARCHAR, 60),
#.........这里部分代码省略.........
示例3: Column
# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import save_dataset [as 别名]
dataset = dart.save_dataset(Dataset(data=DatasetData(
name='weblogs_v01',
table_name='weblogs',
location='s3://example-bucket/weblogs/www.retailmenot.com/ec2/',
data_format=DataFormat(
file_format=FileFormat.TEXTFILE,
row_format=RowFormat.REGEX,
regex_input="(?<ip>^(?:(?:unknown(?:,\\s)?|(?:\\d+\\.\\d+\\.\\d+\\.\\d+(?:,\\s)?))+)|\\S*)\\s+\\S+\\s+(?<userIdentifier>(?:[^\\[]+|\\$\\S+\\['\\S+'\\]|\\[username\\]))\\s*\\s+\\[(?<requestDate>[^\\]]+)\\]\\s+\"(?<httpMethod>(?:GET|HEAD|POST|PUT|DELETE|TRACE))\\s(?<urlPath>(?:[^ ?]+))(?:\\?(?<queryString>(?:[^ ]+)))?\\sHTTP/(?<httpVersion>(?:[\\d\\.]+))\"\\s+(?<statusCode>[0-9]+)\\s+(?<bytesSent>\\S+)\\s+\"(?<referrer>(?:[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*))\"\\s+\"(?<userAgent>(?:[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*))\"\\s+(?<responseTime>[-0-9]*)\\s+\"(?<hostName>(?:[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*))\"\\s+\"(?<userFingerprint>(?:[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*))\"\\s+\"(?<userId>(?:[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*))\"\\s+\"(?<sessionId>(?:[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*))\"\\s+\"(?<requestId>(?:[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*))\"\\s+\"(?<visitorId>(?:[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*))\"\\s+\"(?<vegSlice>(?:[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*))\"\\s+\"(?<fruitSlice>(?:[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*))\"\\s+\"(?<cacheHitMiss>(?:[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*))\"\\s*\\Z",
regex_output="%1$s %2$s %3$s %4$s %5$s %6$s %7$s %8$s %9$s %10$s %11$s %12$s %13$s %14$s %15$s %16$s %17$s %18$s %19$s %20$s %21s",
),
columns=[
Column('ip', DataType.STRING),
Column('user', DataType.STRING),
Column('requestDate', DataType.TIMESTAMP, date_pattern='dd/MMM/yyyy:HH:mm:ss Z'),
Column('httpMethod', DataType.STRING),
Column('urlPath', DataType.STRING),
Column('queryString', DataType.STRING),
Column('httpVersion', DataType.STRING),
Column('statusCode', DataType.STRING),
Column('bytesSent', DataType.INT),
Column('referrer', DataType.STRING),
Column('userAgent', DataType.STRING),
Column('responseTime', DataType.BIGINT),
Column('hostname', DataType.STRING),
Column('userFingerprint', DataType.STRING),
Column('userId', DataType.STRING),
Column('sessionId', DataType.STRING),
Column('requestId', DataType.STRING),
Column('visitorId', DataType.STRING),
Column('vegSlice', DataType.STRING),
Column('fruitSlice', DataType.STRING),
Column('cacheHitMiss', DataType.STRING),
],
compression=Compression.BZ2,
partitions=[
Column('year', DataType.STRING),
Column('week', DataType.STRING),
],
)))
示例4: Column
# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import save_dataset [as 别名]
dataset = dart.save_dataset(Dataset(data=(DatasetData(
name='beacon_native_app_v02',
table_name='beacon_native_app',
location='s3://example-bucket/prd/beacon/native_app/v2/parquet/snappy',
hive_compatible_partition_folders=True,
load_type=LoadType.INSERT,
data_format=DataFormat('parquet'),
columns=[
Column('logFileId', DataType.BIGINT),
Column('lineNumber', DataType.INT),
Column('created', DataType.BIGINT),
Column('remoteip', DataType.STRING),
Column('useragent', DataType.STRING),
Column('eventType', DataType.STRING),
Column('appVersion', DataType.STRING),
Column('advertiserID', DataType.STRING),
Column('couponsOnPage', DataType.INT),
Column('coupons', DataType.STRING),
Column('channel', DataType.STRING),
Column('geoCouponCount', DataType.STRING),
Column('geofence', DataType.STRING),
Column('geofenceTimeSpent', DataType.STRING),
Column('loginStatus', DataType.STRING),
Column('products', DataType.STRING),
Column('session', DataType.STRING),
Column('systemName', DataType.STRING),
Column('systemVersion', DataType.STRING),
Column('udid', DataType.STRING),
Column('userQualifier', DataType.STRING),
Column('url', DataType.STRING),
Column('user_uuid', DataType.STRING),
Column('userId', DataType.STRING),
Column('searchType', DataType.STRING),
Column('searchListTerm', DataType.STRING),
Column('searchTerm', DataType.STRING),
Column('emailUUId', DataType.STRING),
Column('userFingerprint', DataType.STRING),
Column('locationStatus', DataType.STRING),
Column('pushNotificationStatus', DataType.BOOLEAN),
Column('placement', DataType.STRING),
Column('loc', DataType.STRING),
Column('ppoi0', DataType.STRING),
Column('ppoi1', DataType.STRING),
Column('ppoi2', DataType.STRING),
Column('ppoi3', DataType.STRING),
Column('ppoi4', DataType.STRING),
Column('appLaunchNotificationType', DataType.STRING),
Column('scenarioName', DataType.STRING),
Column('behaviorName', DataType.STRING),
Column('couponType', DataType.STRING),
Column('couponPosition', DataType.STRING),
Column('hasQSRContent', DataType.BOOLEAN),
Column('promptName', DataType.STRING),
Column('locationPermissionChanage', DataType.STRING),
Column('couponProblemType', DataType.STRING),
Column('storeTitle', DataType.STRING),
Column('mallName', DataType.STRING),
Column('restaurantName', DataType.STRING),
Column('milesAway', 'float'),
Column('menuItem', DataType.STRING),
Column('toolName', DataType.STRING),
Column('toolAction', DataType.STRING),
Column('toolStep', DataType.STRING),
Column('mallPosition', DataType.INT),
Column('recommendStoreName', DataType.STRING),
Column('recommendStorePosition', DataType.INT),
Column('favoriteStoreName', DataType.STRING),
Column('favoriteStoreAction', DataType.STRING),
Column('favoriteStorePosition', DataType.INT),
Column('favoriteSiteId', DataType.STRING),
Column('receiverName', DataType.STRING),
Column('outclickButtonPrompt', DataType.STRING),
Column('dataSource', DataType.STRING),
Column('searchResultCount', DataType.INT),
Column('searchResultPosition', DataType.INT),
Column('shareType', DataType.STRING),
Column('daysUntilExpiration', DataType.INT),
Column('fireDate', DataType.BIGINT),
Column('settingsChangeValue', DataType.STRING),
Column('settingsChangeType', DataType.STRING),
Column('settingsChangeLocation', DataType.STRING),
Column('clickAction', DataType.STRING),
Column('tnt', DataType.STRING),
Column('previousPage', DataType.STRING),
Column('clickPage', DataType.STRING),
Column('launchReason', DataType.STRING),
Column('taplyticsData', DataType.STRING),
Column('appCampaign', DataType.STRING),
Column('accountMethod', DataType.STRING),
Column('appState', DataType.STRING),
Column('btStatus', DataType.BOOLEAN),
Column('btBeaconId', DataType.STRING),
Column('btBeaconFactoryId', DataType.STRING),
Column('btBeaconName', DataType.STRING),
Column('btTimeSpent', DataType.STRING),
Column('purchaseId', DataType.STRING),
Column('transactionId', DataType.STRING),
Column('outclickLink', DataType.STRING),
Column('outclickPage', DataType.STRING),
Column('featuredCouponPosition', DataType.INT),
#.........这里部分代码省略.........
示例5: Column
# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import save_dataset [as 别名]
dataset = dart.save_dataset(Dataset(data=(DatasetData(
name='rmn_direct_v02',
table_name='rmn_direct',
location='s3://example-bucket/prd/inbound/overlord/raw/rmndirect',
load_type=LoadType.MERGE,
data_format=DataFormat(
file_format=FileFormat.TEXTFILE,
row_format=RowFormat.JSON,
),
compression=Compression.GZIP,
partitions=[
Column('year', DataType.STRING),
Column('month', DataType.STRING),
Column('day', DataType.STRING),
],
columns=[
Column('host', DataType.STRING, path='metadata.host'),
Column('referrer', DataType.STRING, path='owen.context.referrer'),
Column('userAgent', DataType.STRING, path='owen.context.userAgent'),
Column('ipAddress', DataType.STRING, path='owen.context.ipAddress'),
Column('osVersion', DataType.STRING, path='owen.context.osVersion'),
Column('osFamily', DataType.STRING, path='owen.context.osFamily'),
Column('osName', DataType.STRING, path='owen.context.osName'),
Column('browserFamily', DataType.STRING, path='owen.context.browserFamily'),
Column('browserVersion', DataType.STRING, path='owen.context.browserVersion'),
Column('latitude', DataType.STRING, path='owen.context.latitude'),
Column('longitude', DataType.STRING, path='owen.context.longitude'),
Column('dma', DataType.STRING, path='owen.context.dma'),
Column('environment', DataType.STRING, path='owen.context.environment'),
Column('campaign', DataType.STRING, path='owen.context.marketing.campaign'),
Column('channel', DataType.STRING, path='owen.context.marketing.channel'),
Column('content', DataType.STRING, path='owen.context.marketing.content'),
Column('medium', DataType.STRING, path='owen.context.marketing.medium'),
Column('source', DataType.STRING, path='owen.context.marketing.source'),
Column('term', DataType.STRING, path='owen.context.marketing.term'),
Column('sku_0', DataType.STRING, path='owen.context.custom.basket.items[0].sku'),
Column('listPrice_0', DataType.FLOAT, path='owen.context.custom.basket.items[0].listPrice'),
Column('quantity_0', DataType.INT, path='owen.context.custom.basket.items[0].quantity'),
Column('items', DataType.STRING, path='owen.context.custom.basket.items'),
Column('orderDiscountAmount', DataType.STRING, path='owen.context.custom.basket.orderDiscountAmount'),
Column('orderId', DataType.STRING, path='owen.context.custom.basket.orderId'),
Column('inventoryUuid_0', DataType.STRING, path='owen.context.inventory[0].inventoryUuid'),
Column('inventoryType_0', DataType.STRING, path='owen.context.inventory[0].inventoryType'),
Column('outclickUuid_0', DataType.STRING, path='owen.context.inventory[0].outclickUuid'),
Column('key', DataType.STRING, path='schema.key'),
Column('version', DataType.STRING, path='schema.version'),
Column('eventInstanceUuid', DataType.STRING, path='owen.event.eventInstanceUuid'),
Column('eventTimestamp', DataType.STRING, path='owen.event.eventTimestamp'),
Column('eventPlatform', DataType.STRING, path='owen.event.eventPlatform'),
Column('eventCategory', DataType.STRING, path='owen.event.eventCategory'),
Column('eventAction', DataType.STRING, path='owen.event.eventAction'),
Column('eventName', DataType.STRING, path='owen.event.eventName'),
Column('eventTarget', DataType.STRING, path='owen.event.eventTarget'),
Column('eventVersion', DataType.STRING, path='owen.event.eventVersion'),
],
))))
示例6: Column
# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import save_dataset [as 别名]
dataset = dart.save_dataset(Dataset(data=(DatasetData(
name='beacon_native_app_parsed_v01',
table_name='beacon_native_app',
location='s3://example-bucket/nb.retailmenot.com/parsed_logs',
load_type=LoadType.INSERT,
data_format=DataFormat(
FileFormat.TEXTFILE,
RowFormat.DELIMITED,
delimited_by='\t',
quoted_by='"',
escaped_by='\\',
null_string='NULL',
num_header_rows=1
),
compression=Compression.NONE,
partitions=[
Column('year', DataType.STRING),
Column('week', DataType.STRING),
],
columns=[
Column('logFileId', DataType.BIGINT),
Column('lineNumber', DataType.INT),
Column('created', DataType.TIMESTAMP, date_pattern="yyyy-MM-dd HH:mm:ss"),
Column('remoteip', DataType.STRING),
Column('useragent', DataType.STRING),
Column('eventType', DataType.STRING),
Column('appVersion', DataType.STRING),
Column('advertiserID', DataType.STRING),
Column('couponsOnPage', DataType.INT),
Column('coupons', DataType.STRING),
Column('channel', DataType.STRING),
Column('geoCouponCount', DataType.STRING),
Column('geofence', DataType.STRING),
Column('geofenceTimeSpent', DataType.STRING),
Column('loginStatus', DataType.STRING),
Column('products', DataType.STRING),
Column('session', DataType.STRING),
Column('systemName', DataType.STRING),
Column('systemVersion', DataType.STRING),
Column('udid', DataType.STRING),
Column('userQualifier', DataType.STRING),
Column('url', DataType.STRING),
Column('user_uuid', DataType.STRING),
Column('userId', DataType.STRING),
Column('searchType', DataType.STRING),
Column('searchListTerm', DataType.STRING),
Column('searchTerm', DataType.STRING),
Column('emailUUId', DataType.STRING),
Column('userFingerprint', DataType.STRING),
Column('locationStatus', DataType.STRING),
Column('pushNotificationStatus', DataType.BOOLEAN),
Column('placement', DataType.STRING),
Column('loc', DataType.STRING),
Column('ppoi0', DataType.STRING),
Column('ppoi1', DataType.STRING),
Column('ppoi2', DataType.STRING),
Column('ppoi3', DataType.STRING),
Column('ppoi4', DataType.STRING),
Column('appLaunchNotificationType', DataType.STRING),
Column('scenarioName', DataType.STRING),
Column('behaviorName', DataType.STRING),
Column('couponType', DataType.STRING),
Column('couponPosition', DataType.STRING),
Column('hasQSRContent', DataType.BOOLEAN),
Column('promptName', DataType.STRING),
Column('locationPermissionChanage', DataType.STRING),
Column('couponProblemType', DataType.STRING),
Column('storeTitle', DataType.STRING),
Column('mallName', DataType.STRING),
Column('restaurantName', DataType.STRING),
Column('milesAway', 'float'),
Column('menuItem', DataType.STRING),
Column('toolName', DataType.STRING),
Column('toolAction', DataType.STRING),
Column('toolStep', DataType.STRING),
Column('mallPosition', DataType.INT),
Column('recommendStoreName', DataType.STRING),
Column('recommendStorePosition', DataType.INT),
Column('favoriteStoreName', DataType.STRING),
Column('favoriteStoreAction', DataType.STRING),
Column('favoriteStorePosition', DataType.INT),
Column('favoriteSiteId', DataType.STRING),
Column('receiverName', DataType.STRING),
Column('outclickButtonPrompt', DataType.STRING),
Column('dataSource', DataType.STRING),
Column('searchResultCount', DataType.INT),
Column('searchResultPosition', DataType.INT),
Column('shareType', DataType.STRING),
Column('daysUntilExpiration', DataType.INT),
Column('fireDate', DataType.BIGINT),
Column('settingsChangeValue', DataType.STRING),
Column('settingsChangeType', DataType.STRING),
Column('settingsChangeLocation', DataType.STRING),
Column('clickAction', DataType.STRING),
Column('tnt', DataType.STRING),
Column('previousPage', DataType.STRING),
Column('clickPage', DataType.STRING),
Column('launchReason', DataType.STRING),
Column('taplyticsData', DataType.STRING),
Column('appCampaign', DataType.STRING),
#.........这里部分代码省略.........
示例7: Column
# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import save_dataset [as 别名]
dataset = dart.save_dataset(Dataset(data=(DatasetData(
name='owen_outclick_us_v02',
description='Owen outclick data, based on overlord schema version. Considered a replacement for outclick events.',
table_name='outclick',
location='s3://example-bucket/prd/inbound/overlord/raw-firehose-02/rmn-outclicks',
load_type=LoadType.MERGE,
data_format=DataFormat(
file_format=FileFormat.TEXTFILE,
row_format=RowFormat.JSON,
),
compression=Compression.GZIP,
partitions=[
Column('year', DataType.STRING),
Column('month', DataType.STRING),
Column('day', DataType.STRING),
],
primary_keys=['eventInstanceUuid'],
merge_keys=['eventInstanceUuid'],
sort_keys=['eventTimestamp', 'eventInstanceUuid', 'derivedEventInstanceId'],
distribution_keys=['eventInstanceUuid'],
batch_merge_sort_keys=['owenProcessed DESC'],
columns=[
Column('advertiserUuid', DataType.VARCHAR, length=2048, path='owen.context.advertiserUuid'),
Column('appBadgeCount', DataType.INT, path='owen.context.appBadgeCount'),
Column('appForegroundFlag', DataType.BOOLEAN, path='owen.context.appForegroundFlag'),
Column('bluetoothBeaconId', DataType.VARCHAR, length=50, path='owen.context.bluetoothBeaconId'),
Column('bluetoothBeaconType', DataType.VARCHAR, length=25, path='owen.context.bluetoothBeaconType'),
Column('bluetoothEnabledFlag', DataType.BOOLEAN, path='owen.context.bluetoothEnabledFlag'),
Column('breadCrumb', DataType.VARCHAR, length=2048, path='owen.context.breadCrumb'),
Column('browserFamily', DataType.VARCHAR, length=50, path='owen.context.browserFamily'),
Column('browserVersion', DataType.VARCHAR, length=50, path='owen.context.browserVersion'),
Column('carrier', DataType.VARCHAR, length=25, path='owen.context.carrier'),
Column('city', DataType.VARCHAR, length=75, path='owen.context.city'),
Column('connectionType', DataType.VARCHAR, length=25, path='owen.context.connectionType'),
Column('country', DataType.VARCHAR, length=2, path='owen.context.country'),
Column('custom', DataType.VARCHAR, path='owen.context.custom'),
Column('deviceCategory', DataType.VARCHAR, length=2048, path='owen.context.deviceCategory'),
Column('deviceFingerprint', DataType.VARCHAR, length=26, path='owen.context.deviceFingerprint'),
Column('dma', DataType.INT, path='owen.context.dma'),
Column('environment', DataType.VARCHAR, length=2048, path='owen.context.environment'),
Column('experimentObject', DataType.VARCHAR, length=1024, path='owen.context.experiment'),
Column('failureFlag', DataType.BOOLEAN, path='owen.context.failureFlag'),
Column('failureReason', DataType.VARCHAR, length=2048, path='owen.context.failureReason'),
Column('favoriteFlag', DataType.BOOLEAN, path='owen.context.favoriteFlag'),
Column('featureFlags', DataType.VARCHAR, path='owen.context.featureFlags'),
Column('geofenceUuid', DataType.VARCHAR, length=2048, path='owen.context.geofenceUuid'),
Column('inventoryCount', DataType.INT, path='owen.context.inventoryCount'),
Column('inventory_affiliateNetwork', DataType.VARCHAR, length=50, path='owen.context.inventory[0].affiliateNetwork'),
Column('inventory_brand', DataType.VARCHAR, length=100, path='owen.context.inventory[0].brand'),
Column('inventory_claimUuid', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].claimUuid'),
Column('inventory_clickLocation', DataType.VARCHAR, length=100, path='owen.context.inventory[0].clickLocation'),
Column('inventory_commentsCount', DataType.INT, path='owen.context.inventory[0].commentsCount'),
Column('inventory_conquestingFlag', DataType.BOOLEAN, path='owen.context.inventory[0].conquestingFlag'),
Column('inventory_couponRank', DataType.NUMERIC, precision=18, scale=4, path='owen.context.inventory[0].couponRank'),
Column('inventory_deepLinkUrl', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].deepLinkUrl'),
Column('inventory_deepLinkUrlScheme', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].deepLinkUrlScheme'),
Column('inventory_exclusivityFlag', DataType.BOOLEAN, path='owen.context.inventory[0].exclusivityFlag'),
Column('inventory_expirationDate', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].expirationDate'),
Column('inventory_finalPrice', DataType.NUMERIC, precision=18, scale=4, path='owen.context.inventory[0].finalPrice'),
Column('inventory_instoreType', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].instoreType'),
Column('inventory_inventoryChannel', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].inventoryChannel'),
Column('inventory_inventoryName', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].inventoryName'),
Column('inventory_inventorySource', DataType.VARCHAR, length=50, path='owen.context.inventory[0].inventorySource'),
Column('inventory_inventoryType', DataType.VARCHAR, length=25, path='owen.context.inventory[0].inventoryType'),
Column('inventory_inventoryUuid', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].inventoryUuid'),
Column('inventory_lastVerifiedDate', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].lastVerifiedDate'),
Column('inventory_monetizableFlag', DataType.BOOLEAN, path='owen.context.inventory[0].monetizableFlag'),
Column('inventory_noVotes', DataType.INT, path='owen.context.inventory[0].noVotes'),
Column('inventory_onlineType', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].onlineType'),
Column('inventory_originalPrice', DataType.NUMERIC, precision=18, scale=4, path='owen.context.inventory[0].originalPrice'),
Column('inventory_outRedirectUrl', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].outRedirectUrl'),
Column('inventory_outclickUuid', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].outclickUuid'),
Column('inventory_parentInventoryUuid', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].parentInventoryUuid'),
Column('inventory_personalizationFlag', DataType.BOOLEAN, path='owen.context.inventory[0].personalizationFlag'),
Column('inventory_position', DataType.INT, path='owen.context.inventory[0].position'),
Column('inventory_proximity', DataType.NUMERIC, precision=18, scale=4, path='owen.context.inventory[0].proximity'),
Column('inventory_proximityUnit', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].proximityUnit'),
Column('inventory_recommendedFlag', DataType.BOOLEAN, path='owen.context.inventory[0].recommendedFlag'),
Column('inventory_redemptionChannel', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].redemptionChannel'),
Column('inventory_retailCategory', DataType.VARCHAR, length=75, path='owen.context.inventory[0].retailCategory'),
Column('inventory_savedFlag', DataType.BOOLEAN, path='owen.context.inventory[0].savedFlag'),
Column('inventory_siteUuid', DataType.VARCHAR, length=26, path='owen.context.inventory[0].siteUuid'),
Column('inventory_startDate', DataType.VARCHAR, length=2048, path='owen.context.inventory[0].startDate'),
Column('inventory_successPercentage', DataType.NUMERIC, precision=18, scale=4, path='owen.context.inventory[0].successPercentage'),
Column('inventory_usedByCount', DataType.INT, path='owen.context.inventory[0].usedByCount'),
Column('inventory_yesVotes', DataType.INT, path='owen.context.inventory[0].yesVotes'),
Column('ipAddress', DataType.VARCHAR, length=45, path='owen.context.ipAddress'),
Column('language', DataType.VARCHAR, length=6, path='owen.context.language'),
Column('latitude', DataType.NUMERIC, precision=18, scale=4, path='owen.context.latitude'),
Column('locationEnabledFlag', DataType.BOOLEAN, path='owen.context.locationEnabledFlag'),
Column('loggedInFlag', DataType.BOOLEAN, path='owen.context.loggedInFlag'),
Column('longitude', DataType.NUMERIC, precision=18, scale=4, path='owen.context.longitude'),
Column('macAddress', DataType.VARCHAR, length=2048, path='owen.context.macAddress'),
Column('marketing_adGroup', DataType.VARCHAR, length=2048, path='owen.context.marketing.adGroup'),
Column('marketing_campaign', DataType.VARCHAR, length=50, path='owen.context.marketing.campaign'),
Column('marketing_campaignSendCount', DataType.INT, path='owen.context.marketing.campaignSendCount'),
Column('marketing_campaignUuid', DataType.VARCHAR, length=2048, path='owen.context.marketing.campaignUuid'),
Column('marketing_cdRank', DataType.INT, path='owen.context.marketing.cdRank'),
Column('marketing_channel', DataType.VARCHAR, length=50, path='owen.context.marketing.channel'),
Column('marketing_content', DataType.VARCHAR, length=2048, path='owen.context.marketing.content'),
#.........这里部分代码省略.........
示例8: Column
# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import save_dataset [as 别名]
dataset = dart.save_dataset(Dataset(data=(DatasetData(
name='owen_eu_DW-3213_v3',
table_name='owen_eu',
location='s3://example-bucket/prd/inbound/overlord/eu-all-events',
load_type=LoadType.MERGE,
data_format=DataFormat(
file_format=FileFormat.TEXTFILE,
row_format=RowFormat.JSON,
),
compression=Compression.GZIP,
partitions=[
Column('year', DataType.STRING),
Column('month', DataType.STRING),
Column('day', DataType.STRING),
],
columns=[
Column('host', DataType.STRING, path='metadata.host'),
Column('referer', DataType.STRING, path='metadata.referer'),
Column('userAgent', DataType.STRING, path='owen.context.userAgent'),
Column('ipAddress', DataType.STRING, path='owen.context.ipAddress'),
Column('session', DataType.STRING, path='owen.context.session'),
Column('propertyName', DataType.STRING, path='owen.context.propertyName'),
Column('pageName', DataType.STRING, path='owen.context.pageName'),
Column('previousPageName', DataType.STRING, path='owen.context.previousPageName'),
Column('viewInstanceUuid', DataType.STRING, path='owen.context.viewInstanceUuid'),
Column('previousViewInstanceUuid', DataType.STRING, path='owen.context.previousViewInstanceUuid'),
Column('pageType', DataType.STRING, path='owen.context.pageType'),
Column('udid', DataType.STRING, path='owen.context.udid'),
Column('advertiserUuid', DataType.STRING, path='owen.context.advertiserUuid'),
Column('osFamily', DataType.STRING, path='owen.context.osFamily'),
Column('latitude', DataType.STRING, path='owen.context.latitude'),
Column('longitude', DataType.STRING, path='owen.context.longitude'),
Column('userId', DataType.STRING, path='owen.context.custom.legacy.userId'),
Column('geofenceId', DataType.STRING, path='owen.context.custom.legacy.geofenceId'),
Column('userUuid', DataType.STRING, path='owen.context.userUuid'),
Column('offerId', DataType.STRING, path='owen.context.inventory[0].inventoryUuid'),
Column('inventorySource', DataType.STRING, path='owen.context.inventory[0].inventorySource'),
Column('expirationDate', DataType.STRING, path='owen.context.inventory[0].expirationDate'),
Column('position', DataType.STRING, path='owen.context.inventory[0].position'),
Column('offerType', DataType.STRING, path='owen.context.inventory[0].inventoryType'),
Column('eventInstanceUuid', DataType.STRING, path='owen.event.eventInstanceUuid'),
Column('eventTimestamp', DataType.TIMESTAMP, path='owen.event.eventTimestamp', date_pattern="yyyy-MM-dd'T'HH:mm:ss'Z'"),
Column('eventPlatform', DataType.STRING, path='owen.event.eventPlatform'),
Column('eventCategory', DataType.STRING, path='owen.event.eventCategory'),
Column('eventAction', DataType.STRING, path='owen.event.eventAction'),
Column('eventName', DataType.STRING, path='owen.event.eventName'),
Column('eventTarget', DataType.STRING, path='owen.event.eventTarget'),
Column('eventVersion', DataType.STRING, path='owen.event.eventVersion'),
Column('userQualifier', DataType.STRING, path='owen.context.userQualifier'),
Column('outclickUuid', DataType.STRING, path='owen.context.inventory[0].outclickUuid'),
Column('inventoryName', DataType.STRING, path='owen.context.inventory[0].inventoryName'),
Column('enviroment', DataType.STRING, path='owen.context.environment'),
Column('loggedInFlag', DataType.STRING, path='owen.context.loggedInFlag'),
Column('eventPlatformVersion', DataType.STRING, path='owen.event.eventPlatformVersion'),
Column('appForegroundFlag', DataType.BOOLEAN, path='owen.context.appForegroundFlag'),
Column('bluetoothEnabledFlag', DataType.BOOLEAN, path='owen.context.bluetoothEnabledFlag'),
Column('favoriteFlag', DataType.BOOLEAN, path='owen.context.favoriteFlag'),
Column('locationEnabledFlag', DataType.BOOLEAN, path='owen.context.locationEnabledFlag'),
Column('notificationEnabledFlag', DataType.BOOLEAN, path='owen.context.notificationEnabledFlag'),
Column('personalizationFlag', DataType.BOOLEAN, path='owen.context.personalizationFlag'),
Column('macAddress', DataType.STRING, path='owen.context.macAddress'),
Column('osVersion', DataType.STRING, path='owen.context.osVersion'),
Column('osName', DataType.STRING, path='owen.context.osName'),
Column('browserFamily', DataType.STRING, path='owen.context.browserFamily'),
Column('deviceCategory', DataType.STRING, path='owen.context.deviceCategory'),
Column('deviceMake', DataType.STRING, path='owen.context.mobileDeviceMake'),
Column('deviceModel', DataType.STRING, path='owen.context.mobileDeviceModel'),
Column('connectionType', DataType.STRING, path='owen.context.connectionType'),
Column('browserVersion', DataType.STRING, path='owen.context.browserVersion'),
Column('city', DataType.STRING, path='owen.context.city'),
Column('country', DataType.STRING, path='owen.context.country'),
Column('region', DataType.STRING, path='owen.context.region'),
Column('partialSearchTerm', DataType.STRING, path='owen.context.partialSearchTerm'),
Column('outclickURL', DataType.STRING, path='owen.context.inventory[0].outRedirectUrl'),
Column('clickLocation', DataType.STRING, path='owen.context.inventory[0].clickLocation'),
Column('inventoryChannel', DataType.STRING, path='owen.context.inventory[0].inventoryChannel'),
Column('brand', DataType.STRING, path='owen.context.inventory[0].brand'),
Column('commentsCount', DataType.INT, path='owen.context.inventory[0].commentsCount'),
Column('legacyOfferId', DataType.STRING, path='owen.context.custom.legacy.offerIds.offerId'),
Column('pageViewHash', DataType.STRING, path='owen.context.custom.legacy.pageViewHash'),
Column('vIdInt', DataType.STRING, path='owen.context.custom.legacy.vIdInt'),
Column('merchantId', DataType.STRING, path='owen.context.custom.legacy.merchantId'),
Column('facebookConnect', DataType.STRING, path='owen.context.custom.facebookConnect'),
Column('schemaKey', DataType.STRING, path='schema.key'),
],
))))
示例9: Column
# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import save_dataset [as 别名]
dataset = dart.save_dataset(Dataset(data=(DatasetData(
name='owen_eu_DW-3411_v1',
table_name='owen_eu',
location='s3://example-bucket/prd/inbound/overlord/eu-all-events',
load_type=LoadType.MERGE,
data_format=DataFormat(
file_format=FileFormat.TEXTFILE,
row_format=RowFormat.JSON,
),
compression=Compression.GZIP,
partitions=[
Column('year', DataType.STRING),
Column('month', DataType.STRING),
Column('day', DataType.STRING),
],
columns=[
Column('host', DataType.STRING, path='metadata.host'),
Column('referer', DataType.STRING, path='metadata.referer'),
Column('eventName', DataType.STRING, path='owen.event.eventName'),
Column('eventVersion', DataType.STRING, path='owen.event.eventVersion'),
Column('eventPlatform', DataType.STRING, path='owen.event.eventPlatform'),
Column('eventInstanceUuid', DataType.STRING, path='owen.event.eventInstanceUuid'),
Column('eventCategory', DataType.STRING, path='owen.event.eventCategory'),
Column('eventTimestamp', DataType.TIMESTAMP, path='owen.event.eventTimestamp', date_pattern="yyyy-MM-dd'T'HH:mm:ss'Z'"),
Column('eventTarget', DataType.STRING, path='owen.event.eventTarget'),
Column('eventAction', DataType.STRING, path='owen.event.eventAction'),
Column('eventPlatformVersion', DataType.STRING, path='owen.event.eventPlatformVersion'),
Column('osName', DataType.STRING, path='owen.context.osName'),
Column('loggedInFlag', DataType.BOOLEAN, path='owen.context.loggedInFlag'),
Column('custom', DataType.STRING, path='owen.context.custom'),
Column('browserVersion', DataType.STRING, path='owen.context.browserVersion'),
Column('referrer', DataType.STRING, path='owen.context.referrer'),
Column('previousPageName', DataType.STRING, path='owen.context.previousPageName'),
Column('screenHeight', DataType.STRING, path='owen.context.screenHeight'),
Column('breadCrumb', DataType.STRING, path='owen.context.breadCrumb'),
Column('pageName', DataType.STRING, path='owen.context.pageName'),
Column('country', DataType.STRING, path='owen.context.country'),
Column('propertyName', DataType.STRING, path='owen.context.propertyName'),
Column('launchCount', DataType.STRING, path='owen.context.launchCount'),
Column('viewInstanceUuid', DataType.STRING, path='owen.context.viewInstanceUuid'),
Column('osVersion', DataType.STRING, path='owen.context.osVersion'),
Column('connectionType', DataType.STRING, path='owen.context.connectionType'),
Column('partialSearchTerm', DataType.STRING, path='owen.context.partialSearchTerm'),
Column('carrier', DataType.STRING, path='owen.context.carrier'),
Column('longitude', DataType.STRING, path='owen.context.longitude'),
Column('productSectionPosition_0', DataType.STRING, path='owen.context.inventory[0].productSectionPosition'),
Column('savedFlag_0', DataType.BOOLEAN, path='owen.context.inventory[0].savedFlag'),
Column('position_0', DataType.STRING, path='owen.context.inventory[0].position'),
Column('brand_0', DataType.STRING, path='owen.context.inventory[0].brand'),
Column('affiliateNetwork_0', DataType.STRING, path='owen.context.inventory[0].affiliateNetwork'),
Column('deepLinkUrl_0', DataType.STRING, path='owen.context.inventory[0].deepLinkUrl'),
Column('conquestingFlag_0', DataType.BOOLEAN, path='owen.context.inventory[0].conquestingFlag'),
Column('originalPrice_0', DataType.STRING, path='owen.context.inventory[0].originalPrice'),
Column('adUnitUuid_0', DataType.STRING, path='owen.context.inventory[0].adUnitUuid'),
Column('startDate_0', DataType.TIMESTAMP, path='owen.context.inventory[0].startDate', date_pattern="yyyy-MM-dd'T'HH:mm:ss'Z'"),
Column('proximityUnit_0', DataType.STRING, path='owen.context.inventory[0].proximityUnit'),
Column('commentsCount_0', DataType.STRING, path='owen.context.inventory[0].commentsCount'),
Column('outRedirectUrl_0', DataType.STRING, path='owen.context.inventory[0].outRedirectUrl'),
Column('productCardPosition_0', DataType.STRING, path='owen.context.inventory[0].productCardPosition'),
Column('productSectionUuid_0', DataType.STRING, path='owen.context.inventory[0].productSectionUuid'),
Column('lastVerifiedDate_0', DataType.TIMESTAMP, path='owen.context.inventory[0].lastVerifiedDate', date_pattern="yyyy-MM-dd'T'HH:mm:ss'Z'"),
Column('productCardUuid_0', DataType.STRING, path='owen.context.inventory[0].productCardUuid'),
Column('redemptionChannel_0', DataType.STRING, path='owen.context.inventory[0].redemptionChannel'),
Column('noVotes_0', DataType.STRING, path='owen.context.inventory[0].noVotes'),
Column('retailCategory_0', DataType.STRING, path='owen.context.inventory[0].retailCategory'),
Column('couponRank_0', DataType.STRING, path='owen.context.inventory[0].couponRank'),
Column('inventoryChannel_0', DataType.STRING, path='owen.context.inventory[0].inventoryChannel'),
Column('yesVotes_0', DataType.STRING, path='owen.context.inventory[0].yesVotes'),
Column('inventorySource_0', DataType.STRING, path='owen.context.inventory[0].inventorySource'),
Column('inventoryName_0', DataType.STRING, path='owen.context.inventory[0].inventoryName'),
Column('monetizableFlag_0', DataType.BOOLEAN, path='owen.context.inventory[0].monetizableFlag'),
Column('recommendedFlag_0', DataType.BOOLEAN, path='owen.context.inventory[0].recommendedFlag'),
Column('expirationDate_0', DataType.TIMESTAMP, path='owen.context.inventory[0].expirationDate', date_pattern="yyyy-MM-dd'T'HH:mm:ss'Z'"),
Column('clickLocation_0', DataType.STRING, path='owen.context.inventory[0].clickLocation'),
Column('finalPrice_0', DataType.STRING, path='owen.context.inventory[0].finalPrice'),
Column('usedByCount_0', DataType.STRING, path='owen.context.inventory[0].usedByCount'),
Column('proximity_0', DataType.STRING, path='owen.context.inventory[0].proximity'),
Column('inventoryUuid_0', DataType.STRING, path='owen.context.inventory[0].inventoryUuid'),
Column('siteUuid_0', DataType.STRING, path='owen.context.inventory[0].siteUuid'),
Column('outclickUuid_0', DataType.STRING, path='owen.context.inventory[0].outclickUuid'),
Column('adUnitType_0', DataType.STRING, path='owen.context.inventory[0].adUnitType'),
Column('exclusivityFlag_0', DataType.BOOLEAN, path='owen.context.inventory[0].exclusivityFlag'),
Column('inventoryType_0', DataType.STRING, path='owen.context.inventory[0].inventoryType'),
Column('successPercentage_0', DataType.STRING, path='owen.context.inventory[0].successPercentage'),
Column('claimUuid_0', DataType.STRING, path='owen.context.inventory[0].claimUuid'),
Column('region', DataType.STRING, path='owen.context.region'),
Column('session', DataType.STRING, path='owen.context.session'),
Column('content', DataType.STRING, path='owen.context.marketing.content'),
Column('marketingVendor', DataType.STRING, path='owen.context.marketing.vendor'),
Column('campaign', DataType.STRING, path='owen.context.marketing.campaign'),
Column('adGroup', DataType.STRING, path='owen.context.marketing.adGroup'),
Column('campaignUuid', DataType.STRING, path='owen.context.marketing.campaignUuid'),
Column('campaignSendCount', DataType.STRING, path='owen.context.marketing.campaignSendCount'),
Column('source', DataType.STRING, path='owen.context.marketing.source'),
Column('term', DataType.STRING, path='owen.context.marketing.term'),
Column('channel', DataType.STRING, path='owen.context.marketing.channel'),
Column('medium', DataType.STRING, path='owen.context.marketing.medium'),
Column('cdRank', DataType.STRING, path='owen.context.marketing.cdRank'),
Column('notificationUuid', DataType.STRING, path='owen.context.marketing.notificationUuid'),
Column('inventoryCount', DataType.STRING, path='owen.context.inventoryCount'),
#.........这里部分代码省略.........