KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums KX Academy Advanced Capstone: 3.6 exercise help

  • Advanced Capstone: 3.6 exercise help

    Posted by holly on March 19, 2025 at 8:58 am

    Hi all, 

    I have been hitting type error when i tried to run .z.pg for exercise 6 

    Please help to check my .z.pg function in the replies below

    Here is the result, when i had .z.pg running 

    quizItem success description error
    -----------------------------------------------------------------------
    exercise3.2 Pass "check password col is updated" ""
    exercise3.3 Fail ".perm.users should exist on HDB process" "type"
    exercise3.4 Fail "define .z.pw on HDB process" "type"
    exercise3.4 Pass "give access to users with correct password" ""
    exercise3.4 Pass "give access to users with wrong password" ""
    exercise3.5 Fail "return first element of parse tree" "type"
    exercise3.5 Fail "return ! if given update query" "type"
    exercise3.6 Fail "define .z.pg on remote process" "type"
    exercise3.6 Fail "fiauser can run one function" "type"
    exercise3.6 Fail "fiauser cant run tables[]" ""
    exercise3.6 Fail "team members can run any function" "type"



    If i have the .z.pg reset, my tables are working fine

    quizItem success description error ------------------------------------------------------------------------ exercise3.2 Pass "check password col is updated" "" exercise3.3 Pass ".perm.users should exist on HDB process" "" exercise3.4 Pass "define .z.pw on HDB process" "" exercise3.4 Pass "give access to users with correct password" "" exercise3.4 Pass "give access to users with wrong password" "" exercise3.5 Pass "return first element of parse tree" "" exercise3.5 Pass "return ! if given update query" "" exercise3.6 Fail "define .z.pg on remote process" ".z.pg" exercise3.6 Pass "fiauser can run one function" "" exercise3.6 Fail "fiauser cant run tables[]" "" exercise3.6 Pass "team members can run any function" ""




    • This discussion was modified 1 week, 5 days ago by  holly.
    • This discussion was modified 1 week, 5 days ago by  holly.
    • This discussion was modified 1 week, 5 days ago by  holly.
    • This discussion was modified 1 week, 5 days ago by  holly.
    holly replied 1 week, 4 days ago 3 Members · 10 Replies
  • 10 Replies
  • holly

    Member
    March 19, 2025 at 9:03 am

    .z.pg

    hdbH “.z.pg:{permission:.perm.users[.z.u;`api];test:.perm.parseQuery[x];$[permission~`all;value x;($[test~permission;value x;:`notAuthorized])]}”

    • This reply was modified 1 week, 5 days ago by  holly.
    • This reply was modified 1 week, 5 days ago by  holly.
    • This reply was modified 1 week, 5 days ago by  holly.
    • This reply was modified 1 week, 5 days ago by  holly.
  • holly

    Member
    March 19, 2025 at 9:05 am

    ex4: hdbH “.z.pw :{[user;pswd]$[(.Q.sha1 pswd) in select password from `.perm.users;1b;0b]}”

  • holly

    Member
    March 19, 2025 at 9:06 am

    ex5: .perm.parseQuery: { first parse x}

    hdbH (set;`.perm.parseQuery;.perm.parseQuery)

  • holly

    Member
    March 19, 2025 at 9:06 am

    ex2:.perm.users: (“S*S”;enlist “\t”)0: hsym `$getenv[`AX_WORKSPACE],”/AdvancedCapstone.Data/users.txt”

    update password: .Q.sha1 each password from `.perm.users

  • mwoods

    Administrator
    March 19, 2025 at 10:46 am

    This looks correct – you problem is more likely environmental as when I checked your instance the f1 database was missing, I rebooted and reloaded it and ran this code and 3.6 passes. Please DM me if you continue to have issues

    • holly

      Member
      March 20, 2025 at 2:42 am

      hdbH”sensor”

      hdbH “event”

      hdbH “lap”

      date sensorId
      -------------------
      2020.01.02 2
      2020.01.02 3
      2020.01.02 3

      date session lapId time endTime
      --------------------------------------------------
      2020.01.01 P1 1 11:00:26.033 11:00:36.611
      2020.01.01 P1 2 11:00:36.611 11:06:59.897
      2020.01.01 P1 3 11:06:59.897 11:12:06.853
      2020.01.01 P1 4 11:12:06.853 11:19:25.885
      2020.01.01 P1 5 11:19:25.885 11:25:02.752
      2020.01.01 P1 6 11:25:02.752 11:27:11.547
      2020.01.01 P1 7 11:27:11.547 11:36:08.701
      2020.01.01 P1 8 11:36:08.701 11:43:41.360
      2020.01.01 P1 9 11:43:41.360 11:45:51.509
      2020.01.01 P1 10 11:45:51.509 11:45:55.556

      date sensorId session lapId time endTime sensorValue ----------------------------------------------------------------------------- 2020.01.02 tempBackLeft P3 1 12:00:42.329 12:01:14.042 20.61488 2020.01.02 tempBackLeft P3 2 12:01:14.042 12:02:27.094 20.62392 2020.01.02 tempBackLeft P3 3 12:02:27.094 12:02:54.318 20.61883 2020.01.02 tempBackLeft P3 4 12:02:54.318 12:16:52.146 20.621 2020.01.02 tempBackLeft P3 5 12:16:52.146 12:17:12.914 20.61416 2020.01.02 tempBackLeft P3 6 12:17:12.914 12:17:30.610 20.62186 2020.01.02 tempBackLeft P3 7 12:17:30.610 12:21:49.433 20.61864 2020.01.02 tempBackLeft P3 8 12:21:49.433 12:23:43.561 20.61508 2020.01.02 tempBackLeft P3 9 12:23:43.561 12:28:25.547 20.62206 2020.01.02 tempBackLeft P3 10 12:28:25.547 12:28:36.391 20.62515 2020.01.02 tempBackLeft P3 11 12:28:36.391 12:28:56.155 20.60884 2020.01.02 tempBackLeft P3 12 12:28:56.155 12:32:36.277 20.61889 2020.01.02 tempBackLeft P3 13 12:32:36.277 12:39:54.766 20.62077 2020.01.02 tempBackLeft P3 14 12:39:54.766 12:43:03.983 20.62077 2020.01.02 tempBackLeft P3 15 12:43:03.983 12:55:41.601 20.62054 2020.01.02 tempBackLeft P3 16 12:55:41.601 12:56:32.863 20.61843

      • holly

        Member
        March 20, 2025 at 2:55 am

        only issues im noticing is that after i load f1 database to the process, 

        the  sensor table is different to the one i load on disk 

        hdbH"meta sensor"

        c | t f a
        --------| -----
        date | d
        sensorId| j

        meta sensor

        c | t f a
        -----------| -----
        date | d
        sensorId | s p
        time | t
        lapId | j
        units | s
        sensorValue| f
        session | s

        • holly

          Member
          March 20, 2025 at 3:19 am

          dont think this is the issue, i reboot and load the database again , the tables are matching 

          hdbH"meta sensor"

          c | t f a
          -----------| -----
          date | d
          sensorId | s p
          time | t
          lapId | j
          units | s
          sensorValue| f
          session | s

          meta sensor

          c | t f a
          -----------| -----
          date | d
          sensorId | s p
          time | t
          lapId | j
          units | s
          sensorValue| f
          session | s

  • holly

    Member
    March 20, 2025 at 2:20 am

    Hi there, i did load the f1 tables in the hdbH , however im hitting the same issue

    hdbH”tables[]”

    s#`event`lap`sensor

Log in to reply.