尝试在sqlActivity中使用脚本参数时:
 {
"id" : "ActivityId_3zboU",
  "schedule" : { "ref" : "DefaultSchedule" },
  "scriptUri" : "s3://location_of_script/unload.sql",
  "name" : "unload",
  "runsOn" : { "ref" : "Ec2Instance" },
  "scriptArgument" : [ "'s3://location_of_unload/#format(minusDays(@scheduledStartTime,1),'YYYY/MM/dd/hhmm/')}'", "'aws_access_key_id=????;aws_secret_access_key=*******'" ],
  "type" : "SqlActivity",
  "dependsOn" : { "ref" : "ActivityId_YY69k" },
  "database" : { "ref" : "RedshiftCluster" }
}
Run Code Online (Sandbox Code Playgroud)
其中unload.sql脚本包含:
 unload ('
    select *
    from tbl1 
 ')  
 to ?
 credentials  ?
 delimiter ',' GZIP;
Run Code Online (Sandbox Code Playgroud)
要么 :
 unload ('
    select *
    from tbl1 
 ')  
 to ?::VARCHAR(255)
 credentials  ?::VARCHAR(255) 
 delimiter ',' GZIP; …Run Code Online (Sandbox Code Playgroud) amazon-s3 amazon-web-services amazon-redshift amazon-data-pipeline
我正在尝试使用Azure ML中的"执行python脚本"模块创建一个" 读取器 "替代方法来从Azure SQL数据库中读取数据.在这样做时,我正在尝试使用pyodbc库连接到Azure Sql.这是我的代码:
def azureml_main(dataframe1 = None, dataframe2 = None):
    import pyodbc   
    import pandas as pd
    conn = pyodbc.connect('DRIVER={SQL Server}; SERVER=server.database.windows.net; DATABASE=db_name; UID=user; PWD=Password')
    SQLCommand = ('''select * from table1 ''')
    data_frame = pd.read_sql(SQLCommand, conn)
    return data_frame,
Run Code Online (Sandbox Code Playgroud)
还试图使用不同的驱动程序名称:{SQL Server Native Client 11.0}
这是我得到的错误:
Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
Run Code Online (Sandbox Code Playgroud)
有谁知道我应该使用哪个驱动程序?
只是为了确保,我尝试了"{SQL Server}","{SQL Server Native Client 11.0}"和"{SQL Server Native Client 10.0}"并得到了同样的错误
我也尝试了不同的格式:
conn = …Run Code Online (Sandbox Code Playgroud) python pyodbc azure-machine-learning-studio azure-sql-database cortana-intelligence
我创建了一个分区表:
create table  t1 ( amount double) partitioned by ( events_partition_key string) stored as paquet;
Run Code Online (Sandbox Code Playgroud)
向tmp_table添加了一些数据,其中'events_partition_key'列包含以下格式的时间戳(字符串类型):"2018-02-25 00:00:00"
然后我将一些数据插入到分区表中.
insert into table t1 partition (events_partition_key)
select amount, events_partition_key
from tmp_table
Run Code Online (Sandbox Code Playgroud)
当从新的分区表t1中选择时,在某些情况下,events_partition_key列定期呈现与tmp_table中出现的相同,即"2018-02-25 00:00:00",但在大多数情况下,它看起来是URL编码的,即" 2018-02-25 00%3A00%3A00"
在任何情况下,原始列partition_key在URL编码与否的情况下没有区别,
显示新表的分区时:
show partitions t1;
Run Code Online (Sandbox Code Playgroud)
我得到了两次URL编码的两次(即"2018-02-25 00%253A00%253A00"),但有些情况只有一次(即"2018-02-25 00%3A00%3A00")
只有在成为分区键之后,原始值才会出错.
例如,我想通过对象 id 来打乱 json 数组。假设我有这个 json 数组:
 [{"Id":"1", "a":"1", "b":"2"},
  {"Id":"2", "a":"3", "b":"1"},
  {"Id":"3", "a":"5", "b":"1"}]
Run Code Online (Sandbox Code Playgroud)
我想用这个数组更新它
 [{"Id":"1", "a":"32", "b":"42"},
 {"Id":"2", "a":"3", "b":"1", "c":"23"},
  {"Id":"12", "a":"12", "b":"45"}]
Run Code Online (Sandbox Code Playgroud)
预期结果应该是:
[{"Id":"1", "a":"32", "b":"42"},
  {"Id":"2", "a":"3", "b":"1", "c":"23"},
  {"Id":"3", "a":"5", "b":"1"},
  {"Id":"12", "a":"12", "b":"45"}]
Run Code Online (Sandbox Code Playgroud) 我创建了各种大小的数据集,例如1GB,2GB,3GB,4GB(<10 GB),并在Azure ML上执行各种机器学习模型.
1)我可以知道Azure ML服务中提供的服务器规范(RAM,CPU).
2)有时读者会说"内存耗尽"大于4GB的数据.虽然azure ml应该能够按照文档处理10GB的数据.
3)如果我并行运行多个实验(在浏览器的不同选项卡中),则需要更多时间.
4)有没有办法在Azure ML中设置RAM,CPU核心
performance azure azure-machine-learning-studio cortana-intelligence
我正在使用Amazon EMR.我在s3中有一些日志数据,都在同一个桶中,但在不同的子目录下,如:
"s3://bucketname/2014/08/01/abc/file1.bz"
"s3://bucketname/2014/08/01/abc/file2.bz"
"s3://bucketname/2014/08/01/xyz/file1.bz"
"s3://bucketname/2014/08/01/xyz/file3.bz"
Run Code Online (Sandbox Code Playgroud)
我正在使用 :
Set hive.mapred.supports.subdirectories=true;
Set mapred.input.dir.recursive=true;
Run Code Online (Sandbox Code Playgroud)
尝试加载"s3:// bucketname/2014/08 /"中的所有数据时:
CREATE EXTERNAL TABLE table1(id string, at string, 
          custom struct<param1:string, param2:string>)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
LOCATION 's3://bucketname/2014/08/';
Run Code Online (Sandbox Code Playgroud)
作为回报,我得到:
OK
Time taken: 0.169 seconds
Run Code Online (Sandbox Code Playgroud)
在尝试查询表时:
SELECT * FROM table1 LIMIT 10;
Run Code Online (Sandbox Code Playgroud)
我明白了:
Failed with exception java.io.IOException:java.io.IOException: Not a file: s3://bucketname/2014/08/01
Run Code Online (Sandbox Code Playgroud)
有没有人知道如何减少这个?