Can not query the dp1.Object detail even if I can query the tap_schema

I am pretty new to the data access.
I have the data right, and I can get expected result like below.
query = “”"

  • SELECT column_name, datatype, description, unit*
  • FROM tap_schema.columns*
  • WHERE table_name = ‘dp1.Object’*
    “”"
    results = service.search(query).to_table().to_pandas()
    results

However, if I try the code below, it just return Job phase is ERROR.
query = “”"

  • SELECT TOP 10*
  • obj.objectId as objectId*
  • FROM dp1.Object as obj*
  • “”"*
    job = service.submit_job(query)
    job.run()
    job.wait(phases=[‘COMPLETED’, ‘ERROR’])
    print(‘Job phase is’, job.phase)

Does anyone know how could this happen?
Thank you in advance if anyone can provide any help.

Is this from a notebook? Maybe see what information is given at the URL given by
job.url
Your post might have come through with some formatting attached so not sure if this is the same but this works for me

from lsst.rsp import get_tap_service, retrieve_query

service = get_tap_service("tap")
assert service is not None

query = "select TOP 10 "\
        "obj.objectId as objectId "\
        "FROM dp1.Object as obj "
print(query)

job = service.submit_job(query)
job.run()
job.wait(phases=['COMPLETED', 'ERROR'])
print('Job phase is', job.phase)

results = job.fetch_result().to_table().to_pandas()

print(results)