Azure Synapse学习笔记(1)- Demo跑起来

MSDN -> Synapse -> QuickStarts -> 2 Analyze using serveless SQL pool

https://docs.microsoft.com/en-us/azure/synapse-analytics/get-started-analyze-sql-on-demand

  1. In Synapse Studio, go to the Develop hub

  2. Create a new SQL script.

  3. Paste the following code into the script.

    SQLCopy

    SELECT
        TOP 100 *
    FROM
        OPENROWSET(
            BULK 'https://contosolake.dfs.core.windows.net/users/NYCTripSmall.parquet',
            FORMAT='PARQUET'
        ) AS [result]
    
  4. Click Run.

第三步,照着做会报错,contosolake看起来就是个假名字,报错信息如下

File 'https://contosolake.dfs.core.windows.net/users/NYCTripSmall.parquet' cannot be opened because it does not exist or it is used by another process.

经过一番查找,问题的解决方法MSDN 写在了一般不会看的第一步中

MSDN -> Synapse -> QuickStarts -> 1 Creating a Synapse workspace

https://docs.microsoft.com/en-us/azure/synapse-analytics/get-started-create-workspace

Place sample data into the primary storage account

We are going to use a small 100K row sample dataset of NYX Taxi Cab data for many examples in this getting started guide. We begin by placing it in the primary storage account you created for the workspace.

Once the parquet file is uploaded it is available through two equivalent URIs:

  • https://contosolake.dfs.core.windows.net/users/NYCTripSmall.parquet
  • abfss://users@contosolake.dfs.core.windows.net/NYCTripSmall.parquet

In the examples that follow in this tutorial, make sure to replace contosolake in the UI with the name of the primary storage account that you selected for your workspace.

简言之就是先去https://azuresynapsestorage.blob.core.windows.net/sampledata/NYCTaxiSmall/NYCTripSmall.parquet这里下载这个示例数据,然后上传到自己的Storage中,然后把contosolake换成自己的Storage Account名字。当然,如果自己的container名字不是user,那么URL中container也需要替换掉。

SELECT
    TOP 100 *
FROM
    OPENROWSET(
        BULK 'https://{StorageAccountName}.dfs.core.windows.net/{ContainerName}/NYCTripSmall.parquet',
        FORMAT='PARQUET'
    ) AS [result]

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

tonytonychopper

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值