Thread
#help
    r

    Robin Moffatt

    1 week ago
    I’m completely new to LakeFS, and working my way through this blog. (I’m also new to Trino, so I don’t know if that’s complicating matters) I’m a bit puzzled/stuck on this step, where after creating a branch I create a new table:
    CREATE TABLE s3.tiny_v2.orders (
      orderkey bigint,
      custkey bigint,
      orderstatus varchar(1),
      totalprice double,
      orderdate date,
      orderpriority varchar(15),
      clerk varchar(15),
      shippriority integer,
      comment varchar(79)
      ) WITH (
        external_location = '<s3a://example/main/tiny_v2/orders>',
        format = 'ORC'
    );
    My questions so far:1. If the Trino schema has a location
    location = '<s3a://example/v2/tiny>'
    then why is the external location for the table still under
    main
    (
    external_location = '<s3a://example/main/tiny_v2/orders>'
    ) ? 2. What should I see as a result of creating this if it does work? In my head I’m expecting, since it’s a branch off main, to see 15k records, is that right?
    trino:> select count(*) from s3.tiny.orders;
     _col0
    -------
     15000
    (1 row)
    
    trino:> select count(*) from s3.tiny_v2.orders;
     _col0
    -------
         0
    (1 row)
    TIA 🙂
    After the initial
    create table as select
    statements in the blog that populate the data, should there be a commit in lakeFS?
    so I went back and did a commit on
    main
    , then branched to a new branch (
    v3
    ). I then created my v3_orders table against
    external_location = '<s3a://example/v3/tiny/orders>'
    This worked:
    trino:tiny_v2> select count(*) from s3.tiny_v3.orders;
     _col0
    -------
     15000
    (1 row)
    Guy Hardonag

    Guy Hardonag

    1 week ago
    Hi @Robin Moffatt, Welcome to lakeFS 😄 1. You are correct, It shouldn’t be the path, looks like a mistake ( we will fix by the end of the week), using the external_path main will create the table on the main branch and any changes done to that table will be reflected on main. 2. Regardless to the branch the table is created in a different location (
    tiny/orders
    ->
    tiny_v2/orders
    ) there aren’t any records in the new location (try using the external location
    <s3a://example/v2/tiny/orders>'
    ) Thank you very much for pointing this out.
    r

    Robin Moffatt

    1 week ago
    thanks @Guy Hardonag. And am I right in thinking there should be the instruction in the blog to commit the
    main
    branch before creating the
    v2
    branch?
    Guy Hardonag

    Guy Hardonag

    1 week ago
    3. Correct again, after the initial
    create table as select
    statement there should be a commit.
    Thanks again for pointing this out, and sorry for the confusion. 🙏
    r

    Robin Moffatt

    1 week ago
    👍 thanks for the help
    and it’s fun digging in to try and figure out what’s going on 🙂
    Guy Hardonag

    Guy Hardonag

    1 week ago
    At least it was fun, and you got it all right 👍
    r

    Robin Moffatt

    1 week ago
    whilst we’re at it, there’s an error on the first blog too — under
    Using the Everything Bagel
    the trino client command has had its
    --
    mangled into
    docker compose — profile client run — rm trino-client
    should be
    docker compose --profile client run --rm trino-client
    Guy Hardonag

    Guy Hardonag

    1 week ago
    Will fix that as well. Thanks 🙏 🙏 🙏