Sex: female, Age: 38.0, SibSp: 1, Parch: 0, Ticket: PC 17599, Fare: 71.2833, Cabin: C85, Embarked: C\n3. PassengerId: 3, Survived: 1, Pclass: 3, Name: Heikkinen, Miss. Laina, Sex: female, Age: 26.0, SibSp: 0, Parch: 0, Ticket: STON/O2. 3101282, Fare: 7.925, Cabin: None, Embarked: S'Example: running queries‚Äãagent_executor.run("whats the square root of the average age?")            > Entering new AgentExecutor chain...    Action: list_tables_sql_db    Action Input:     Observation: titanic    Thought:I should check the schema of the titanic table to see if there is an age column.    Action: schema_sql_db    Action Input: titanic    Observation: CREATE TABLE langchain_example.titanic (      PassengerId INT,      Survived INT,      Pclass INT,      Name STRING,      Sex STRING,      Age DOUBLE,      SibSp INT,      Parch INT,      Ticket STRING,      Fare DOUBLE,      Cabin STRING,      Embarked STRING)    ;        /*    3 rows from titanic table:    PassengerId Survived    Pclass  Name    Sex Age SibSp   Parch   Ticket  Fare    Cabin   Embarked    1   0   3   Braund, Mr. Owen Harris male    22.0    1   0   A/5 21171   7.25    None    S    2   1   1   Cumings, Mrs. John Bradley (Florence Briggs Thayer) female  38.0    1   0   PC 17599    71.2833 C85 C    3   1   3   Heikkinen, Miss. Laina  female  26.0    0   0   STON/O2. 3101282    7.925   None    S    */    Thought:There is an Age column in the titanic table. I should write a query to calculate the average age and then find the square root of the result.    Action: query_checker_sql_db    Action Input: SELECT SQRT(AVG(Age)) as square_root_of_avg_age FROM titanic    Observation: The original query seems to be correct. Here it is again:        SELECT SQRT(AVG(Age)) as square_root_of_avg_age FROM titanic    Thought:The query is correct, so I can execute it to find the square root of the average age.    Action: query_sql_db    Action Input: SELECT SQRT(AVG(Age)) as square_root_of_avg_age FROM titanic    Observation:
This notebook shows how to use agents to interact with Spark SQL. Similar to SQL Database Agent, it is designed to address general inquiries about Spark SQL and facilitate error recovery.
This notebook shows how to use agents to interact with Spark SQL. Similar to SQL Database Agent, it is designed to address general inquiries about Spark SQL and facilitate error recovery. ->: Sex: female, Age: 38.0, SibSp: 1, Parch: 0, Ticket: PC 17599, Fare: 71.2833, Cabin: C85, Embarked: C\n3. PassengerId: 3, Survived: 1, Pclass: 3, Name: Heikkinen, Miss. Laina, Sex: female, Age: 26.0, SibSp: 0, Parch: 0, Ticket: STON/O2. 3101282, Fare: 7.925, Cabin: None, Embarked: S'Example: running queries‚Äãagent_executor.run("whats the square root of the average age?")            > Entering new AgentExecutor chain...    Action: list_tables_sql_db    Action Input:     Observation: titanic    Thought:I should check the schema of the titanic table to see if there is an age column.    Action: schema_sql_db    Action Input: titanic    Observation: CREATE TABLE langchain_example.titanic (      PassengerId INT,      Survived INT,      Pclass INT,      Name STRING,      Sex STRING,      Age DOUBLE,      SibSp INT,      Parch INT,      Ticket STRING,      Fare DOUBLE,      Cabin STRING,      Embarked STRING)    ;        /*    3 rows from titanic table:    PassengerId Survived    Pclass  Name    Sex Age SibSp   Parch   Ticket  Fare    Cabin   Embarked    1   0   3   Braund, Mr. Owen Harris male    22.0    1   0   A/5 21171   7.25    None    S    2   1   1   Cumings, Mrs. John Bradley (Florence Briggs Thayer) female  38.0    1   0   PC 17599    71.2833 C85 C    3   1   3   Heikkinen, Miss. Laina  female  26.0    0   0   STON/O2. 3101282    7.925   None    S    */    Thought:There is an Age column in the titanic table. I should write a query to calculate the average age and then find the square root of the result.    Action: query_checker_sql_db    Action Input: SELECT SQRT(AVG(Age)) as square_root_of_avg_age FROM titanic    Observation: The original query seems to be correct. Here it is again:        SELECT SQRT(AVG(Age)) as square_root_of_avg_age FROM titanic    Thought:The query is correct, so I can execute it to find the square root of the average age.    Action: query_sql_db    Action Input: SELECT SQRT(AVG(Age)) as square_root_of_avg_age FROM titanic    Observation: