<?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 Re: Limited Results When trying to Access Delta Shared Tables from C# in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/limited-results-when-trying-to-access-delta-shared-tables-from-c/m-p/100979#M8861</link>
    <description>&lt;P&gt;This is very frustrating. The documentation for the Delta Sharing REST API is very bad. When I run a query, I get back a bunch of meta data describing the Parquet files instead of the actual rows of data. The Delta Sharing REST API is a huge hassle to use from C#. For this reason, many of my team members have resolved to simply use Python which unfortunately is not as useful a language as C# IMO.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2024 21:55:04 GMT</pubDate>
    <dc:creator>Shawn_Eary</dc:creator>
    <dc:date>2024-12-04T21:55:04Z</dc:date>
    <item>
      <title>Limited Results When trying to Access Delta Shared Tables from C#</title>
      <link>https://community.databricks.com/t5/get-started-discussions/limited-results-when-trying-to-access-delta-shared-tables-from-c/m-p/100156#M8858</link>
      <description>&lt;P&gt;This C# code only seems to return about 8 rows when it should return 100:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// Per Databricks AI, you must run the following command if you don't
// want to get an error about delta.enableDeltionVectors from C#:
// ALTER TABLE [myCatalog].setest.billboard_hot_100 SET TBLPROPERTIES (delta.enableDeletionVectors = false);
//
// This code was mostly written by Databricks AI but some other AI tools
// were used.
using System.Net.Http.Headers;

class Program
{
  private static readonly string bearerToken = "[myBearerToken]";
  private static readonly string endpoint = "https://[myRegion].azuredatabricks.net/api/2.0/delta-sharing/metastores/[myGUID]/shares/seary_billboard_100_test_share/schemas/setest/tables/billboard_hot_100/query";

  static async Task Main(string[] args)
  {
    using (HttpClient client = new HttpClient())
    {
      client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", bearerToken);
      client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

      var content = new StringContent("{\"responseFormat\": \"delta\"}", System.Text.Encoding.UTF8, "application/json");
      HttpResponseMessage response = await client.PostAsync(endpoint, content);

      if (response.IsSuccessStatusCode)
      {
        string responseData = await response.Content.ReadAsStringAsync();
        Console.WriteLine("Response Data:");
        Console.WriteLine(responseData);
        File.WriteAllText("c:\\Users\\seary\\Downloads\\billBoard100-deltaShareResults.json", responseData);
      }
      else
      {
        Console.WriteLine($"Error: {response.StatusCode}");
        string errorData = await response.Content.ReadAsStringAsync();
        Console.WriteLine("Error Data:");
        Console.WriteLine(errorData);
      }
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;Also, the returned JSON seems slightly corrupt to me. How can I get the above code to return all 100 rows from&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;seary_billboard_100_test_share.setest.billboard_hot_100?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 26 Nov 2024 19:59:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/limited-results-when-trying-to-access-delta-shared-tables-from-c/m-p/100156#M8858</guid>
      <dc:creator>Shawn_Eary</dc:creator>
      <dc:date>2024-11-26T19:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Limited Results When trying to Access Delta Shared Tables from C#</title>
      <link>https://community.databricks.com/t5/get-started-discussions/limited-results-when-trying-to-access-delta-shared-tables-from-c/m-p/100284#M8859</link>
      <description>&lt;P&gt;Can you try with the ODBC driver?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.databricks.com/en/integrations/odbc/index.html" target="_blank"&gt;https://docs.databricks.com/en/integrations/odbc/index.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 02:12:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/limited-results-when-trying-to-access-delta-shared-tables-from-c/m-p/100284#M8859</guid>
      <dc:creator>gchandra</dc:creator>
      <dc:date>2024-11-28T02:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Limited Results When trying to Access Delta Shared Tables from C#</title>
      <link>https://community.databricks.com/t5/get-started-discussions/limited-results-when-trying-to-access-delta-shared-tables-from-c/m-p/100667#M8860</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/8379"&gt;@gchandra&lt;/a&gt;&amp;nbsp;you have a really good point.&lt;BR /&gt;&lt;BR /&gt;If I Remember Correctly (IIRC), C# can get to the data I need using a service account and Personal Access Token (PAT) against the &lt;A href="https://docs.databricks.com/en/dev-tools/sql-execution-tutorial.html" target="_self"&gt;SQL Statement Execution API&lt;/A&gt;. I don't think I've tried ODBC yet though.&lt;BR /&gt;&lt;BR /&gt;My team specifically wants me to use Delta Sharing (in this case) for two different reasons:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Delta Sharing does not require us to spin a cluster up to get a result.&lt;/LI&gt;&lt;LI&gt;Delta Sharing is easier to use with customers outside our organization.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;It would be preferable if I could access &lt;STRONG&gt;Delta Sharing&lt;/STRONG&gt; libraries directly from C# through a library or the REST API mentioned in my original post, but right now, I don't think that works so I've experimented with other means.&lt;BR /&gt;&lt;BR /&gt;I managed to trigger Python code to call the Delta Sharing libraries using C#'s System.Diagnostics.Process. This works well for simple examples, but it's clunky and I'm concerned it might break in complex situations. On the other hand, I had a coworker suggest I also try calling the Delta Sharing libraries using Python.NET. Unfortunately, the latest version of Python.NET seems a little buggy to me and while it does appear to be getting back the correct data, there seem to be some "security issues" that prevent the processes it launches from terminating properly.&lt;/P&gt;&lt;P&gt;Yes, ODBC (or the SQL Statement Execution API) might be how I would personally work around these problems, but I'm not sure my team agrees with me. From a team perspective, it would be useful if Databricks could support a native C# library for Delta Sharing. It's currently a lot of unnecessary work to use C# to pull data from Databricks.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 22:22:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/limited-results-when-trying-to-access-delta-shared-tables-from-c/m-p/100667#M8860</guid>
      <dc:creator>Shawn_Eary</dc:creator>
      <dc:date>2024-12-02T22:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Limited Results When trying to Access Delta Shared Tables from C#</title>
      <link>https://community.databricks.com/t5/get-started-discussions/limited-results-when-trying-to-access-delta-shared-tables-from-c/m-p/100979#M8861</link>
      <description>&lt;P&gt;This is very frustrating. The documentation for the Delta Sharing REST API is very bad. When I run a query, I get back a bunch of meta data describing the Parquet files instead of the actual rows of data. The Delta Sharing REST API is a huge hassle to use from C#. For this reason, many of my team members have resolved to simply use Python which unfortunately is not as useful a language as C# IMO.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 21:55:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/limited-results-when-trying-to-access-delta-shared-tables-from-c/m-p/100979#M8861</guid>
      <dc:creator>Shawn_Eary</dc:creator>
      <dc:date>2024-12-04T21:55:04Z</dc:date>
    </item>
  </channel>
</rss>

