Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make StorageOptions editable in TableOptions #92

Closed
akulOn opened this issue Oct 18, 2024 · 3 comments · Fixed by #95
Closed

Make StorageOptions editable in TableOptions #92

akulOn opened this issue Oct 18, 2024 · 3 comments · Fixed by #95
Assignees

Comments

@akulOn
Copy link

akulOn commented Oct 18, 2024

Hi guys,

Thanks for adding the storage options!

I downloaded the latest package from nuget, but I can't set the StorageOptions in TableOptions on LoadAsync.

using DeltaLake.Runtime;
using DeltaLake.Table;
using Microsoft.AspNetCore.Mvc;

namespace DeltaTest.Controllers
{
    [Route("api/delta")]
    [ApiController]
    public class DeltaController : ControllerBase
    {
        [HttpGet]
        public async Task<IActionResult> Get()
        {
            var deltaRuntime = new DeltaRuntime(RuntimeOptions.Default);

            var deltaTable = await DeltaTable.LoadAsync(
                deltaRuntime,
                "abfss://[email protected]/branches/people/",
                new TableOptions
                {
                    StorageOptions = new Dictionary<string, string>() <- **this is where I get the error**
                },
                CancellationToken.None);

            return Ok(deltaTable);
        }
    }
}

I noticed this in the TableOptions class

using System.Collections.Generic;

namespace DeltaLake.Table;

//
// Summary:
//     Options for creating a new delta table
public class TableOptions
{
    //
    // Summary:
    //     Optional version of the table to load
    public ulong? Version { get; set; }

    //
    // Summary:
    //     A map of string options
    public Dictionary<string, string> StorageOptions { get; } = new Dictionary<string, string>(); <- **could you add init/set here?**


    //
    // Summary:
    //     Whether or not to load files when building the table
    public bool WithoutFiles { get; set; }

    //
    // Summary:
    //     Buffer size for log files
    public uint? LogBufferSize { get; set; }
}

Could you make the StorageOptions editable on init in the TableOptions class?

@mightyshazam
Copy link
Collaborator

This is in the latest main. However, we haven't pushed a nuget package with the change. @mdrakiburrahman is working on a PR to add async functionality to his latest change. Then we will push out a new package with this change.
For now, the only option is pulling the code locally.

@akulOn
Copy link
Author

akulOn commented Oct 18, 2024

Thanks for the quick response @mightyshazam! I'll pull the code locally and see how far I can get.

@mdrakiburrahman
Copy link
Collaborator

Hey gents,

Just an update that I'm working on implementing the Nuget package for an app similar to KDI that works with Event Hub C# SDK and stresses this delta-dotnet package - I plan on finishing that work in the next 3-4 days.

From there, any lessons learned, and this issue:

#91

Will be solved in a PR in the next few days.

@mdrakiburrahman mdrakiburrahman self-assigned this Oct 21, 2024
@mdrakiburrahman mdrakiburrahman linked a pull request Oct 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants