<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Connecting to Serverless Redshift from a Databricks Notebook in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/connecting-to-serverless-redshift-from-a-databricks-notebook/m-p/65964#M32973</link>
    <description>&lt;P&gt;Hello Experts,&amp;nbsp;&lt;/P&gt;&lt;P&gt;A new databricks user here. I am trying to access an Redshift serverless table using a databricks notebook.&amp;nbsp;&lt;BR /&gt;Here is what happens when I try the below code,&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;df = spark.read.format("&lt;/SPAN&gt;&lt;SPAN&gt;redshift&lt;/SPAN&gt;&lt;SPAN&gt;")\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.option("&lt;/SPAN&gt;&lt;SPAN&gt;dbtable&lt;/SPAN&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;&lt;SPAN&gt;public.customer&lt;/SPAN&gt;&lt;SPAN&gt;")\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.option("&lt;/SPAN&gt;&lt;SPAN&gt;tempdir&lt;/SPAN&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;&lt;SPAN&gt;s3://BLAH/rs-temp/&lt;/SPAN&gt;&lt;SPAN&gt;")\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.option("&lt;/SPAN&gt;&lt;SPAN&gt;url&lt;/SPAN&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;&lt;SPAN&gt;jdbc:redshift://BLAH:5439/dev&lt;/SPAN&gt;&lt;SPAN&gt;")\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.option("&lt;/SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;SPAN&gt;")\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.option("&lt;/SPAN&gt;&lt;SPAN&gt;password&lt;/SPAN&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;&lt;SPAN&gt;password&lt;/SPAN&gt;&lt;SPAN&gt;")\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.load()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;df.show(10,False)&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;It fails with the below error&amp;nbsp;&lt;BR /&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;IllegalArgumentException: &lt;/SPAN&gt;&lt;SPAN&gt;requirement failed: You must specify a method for authenticating Redshift's connection to S3 (aws_iam_role, forward_spark_s3_credentials, or temporary_aws_*. For a discussion of the differences between these options, please see the README.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;If I edit the format to "jdbc", it works no issue. I am on&amp;nbsp;&lt;SPAN&gt;13.3 LTS (includes Apache Spark 3.4.1, Scala 2.12)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I don't have an instance profile role. Why wouldn't the format("redshift") use the provided username and password and connect to redshift? What config should I be using?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Apr 2024 00:50:37 GMT</pubDate>
    <dc:creator>arunak</dc:creator>
    <dc:date>2024-04-10T00:50:37Z</dc:date>
    <item>
      <title>Connecting to Serverless Redshift from a Databricks Notebook</title>
      <link>https://community.databricks.com/t5/data-engineering/connecting-to-serverless-redshift-from-a-databricks-notebook/m-p/65964#M32973</link>
      <description>&lt;P&gt;Hello Experts,&amp;nbsp;&lt;/P&gt;&lt;P&gt;A new databricks user here. I am trying to access an Redshift serverless table using a databricks notebook.&amp;nbsp;&lt;BR /&gt;Here is what happens when I try the below code,&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;df = spark.read.format("&lt;/SPAN&gt;&lt;SPAN&gt;redshift&lt;/SPAN&gt;&lt;SPAN&gt;")\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.option("&lt;/SPAN&gt;&lt;SPAN&gt;dbtable&lt;/SPAN&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;&lt;SPAN&gt;public.customer&lt;/SPAN&gt;&lt;SPAN&gt;")\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.option("&lt;/SPAN&gt;&lt;SPAN&gt;tempdir&lt;/SPAN&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;&lt;SPAN&gt;s3://BLAH/rs-temp/&lt;/SPAN&gt;&lt;SPAN&gt;")\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.option("&lt;/SPAN&gt;&lt;SPAN&gt;url&lt;/SPAN&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;&lt;SPAN&gt;jdbc:redshift://BLAH:5439/dev&lt;/SPAN&gt;&lt;SPAN&gt;")\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.option("&lt;/SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;SPAN&gt;")\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.option("&lt;/SPAN&gt;&lt;SPAN&gt;password&lt;/SPAN&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;&lt;SPAN&gt;password&lt;/SPAN&gt;&lt;SPAN&gt;")\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.load()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;df.show(10,False)&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;It fails with the below error&amp;nbsp;&lt;BR /&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;IllegalArgumentException: &lt;/SPAN&gt;&lt;SPAN&gt;requirement failed: You must specify a method for authenticating Redshift's connection to S3 (aws_iam_role, forward_spark_s3_credentials, or temporary_aws_*. For a discussion of the differences between these options, please see the README.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;If I edit the format to "jdbc", it works no issue. I am on&amp;nbsp;&lt;SPAN&gt;13.3 LTS (includes Apache Spark 3.4.1, Scala 2.12)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I don't have an instance profile role. Why wouldn't the format("redshift") use the provided username and password and connect to redshift? What config should I be using?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 00:50:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/connecting-to-serverless-redshift-from-a-databricks-notebook/m-p/65964#M32973</guid>
      <dc:creator>arunak</dc:creator>
      <dc:date>2024-04-10T00:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to Serverless Redshift from a Databricks Notebook</title>
      <link>https://community.databricks.com/t5/data-engineering/connecting-to-serverless-redshift-from-a-databricks-notebook/m-p/66040#M32996</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/103426"&gt;@arunak&lt;/a&gt;&amp;nbsp;- we need to specify&amp;nbsp;&lt;STRONG&gt;forward_spark_s3_credentials to true during read.&lt;/STRONG&gt; This will help spark detect the credentials used to authenticate to the S3 bucket and use these credentials to r read from redshift.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 20:10:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/connecting-to-serverless-redshift-from-a-databricks-notebook/m-p/66040#M32996</guid>
      <dc:creator>shan_chandra</dc:creator>
      <dc:date>2024-04-10T20:10:24Z</dc:date>
    </item>
  </channel>
</rss>

