|
761 | 761 | "</div>[5 rows x 15 columns in total]" |
762 | 762 | ], |
763 | 763 | "text/plain": [ |
764 | | - " result \\\n", |
| 764 | + " result \\n", |
765 | 765 | "0 {'application_number': None, 'class_internatio... \n", |
766 | 766 | "1 {'application_number': None, 'class_internatio... \n", |
767 | 767 | "2 {'application_number': None, 'class_internatio... \n", |
768 | 768 | "3 {'application_number': None, 'class_internatio... \n", |
769 | 769 | "4 {'application_number': None, 'class_internatio... \n", |
770 | 770 | "\n", |
771 | | - " gcs_path issuer language \\\n", |
| 771 | + " gcs_path issuer language \\n", |
772 | 772 | "0 gs://gcs-public-data--labeled-patents/espacene... EU DE \n", |
773 | 773 | "1 gs://gcs-public-data--labeled-patents/espacene... EU DE \n", |
774 | 774 | "2 gs://gcs-public-data--labeled-patents/espacene... EU DE \n", |
775 | 775 | "3 gs://gcs-public-data--labeled-patents/espacene... EU DE \n", |
776 | 776 | "4 gs://gcs-public-data--labeled-patents/espacene... EU DE \n", |
777 | 777 | "\n", |
778 | | - " publication_date class_international class_us application_number \\\n", |
| 778 | + " publication_date class_international class_us application_number \\n", |
779 | 779 | "0 29.08.018 E04H 6/12 <NA> 18157874.1 \n", |
780 | 780 | "1 03.10.2018 H05B 6/12 <NA> 18165514.3 \n", |
781 | 781 | "2 03.10.2018 H01L 21/20 <NA> 18166536.5 \n", |
782 | 782 | "3 03.10.2018 A01K 31/00 <NA> 18171005.4 \n", |
783 | 783 | "4 03.10.2018 G06F 11/30 <NA> 18157347.8 \n", |
784 | 784 | "\n", |
785 | | - " filing_date priority_date_eu representative_line_1_eu \\\n", |
| 785 | + " filing_date priority_date_eu representative_line_1_eu \\n", |
786 | 786 | "0 21.02.2018 22.02.2017 Liedtke & Partner Patentanw√§lte \n", |
787 | 787 | "1 03.04.2018 30.03.2017 <NA> \n", |
788 | 788 | "2 16.02.2016 <NA> Scheider, Sascha et al \n", |
789 | 789 | "3 05.02.2015 05.02.2014 Stork Bamberger Patentanw√§lte \n", |
790 | 790 | "4 19.02.2018 31.03.2017 Hoffmann Eitle \n", |
791 | 791 | "\n", |
792 | | - " applicant_line_1 inventor_line_1 \\\n", |
| 792 | + " applicant_line_1 inventor_line_1 \\n", |
793 | 793 | "0 SHB Hebezeugbau GmbH VOLGER, Alexander \n", |
794 | 794 | "1 BSH Hausger√§te GmbH Acero Acero, Jesus \n", |
795 | 795 | "2 EV Group E. Thallner GmbH Kurz, Florian \n", |
|
815 | 815 | "bpd._read_gbq_colab(\"\"\"\n", |
816 | 816 | " SELECT\n", |
817 | 817 | " AI.GENERATE(\n", |
818 | | - " prompt=>(\\\"Extract the values.\\\", OBJ.GET_ACCESS_URL(OBJ.FETCH_METADATA(OBJ.MAKE_REF(gcs_path, \\\"us.conn\\\")), \\\"r\\\")),\n", |
| 818 | + " prompt=>(\\\"Extract the values.\\\\", OBJ.GET_ACCESS_URL(OBJ.FETCH_METADATA(OBJ.MAKE_REF(gcs_path, \\\\"us.conn\\\\")), \\\\"r\\\\\")),\n", |
819 | 819 | " connection_id=>\\\"bigframes-dev.us.bigframes-default-connection\\\",\n", |
820 | | - " output_schema=>\\\"publication_date string, class_international string, application_number string, filing_date string\\\") AS result,\n", |
| 820 | + " output_schema=>\\\"publication_date string, class_international string, application_number string, filing_date string\\\"\n", |
| 821 | + " ) AS result,\n", |
821 | 822 | " *\n", |
822 | 823 | " FROM `bigquery-public-data.labeled_patents.extracted_data`\n", |
823 | 824 | " LIMIT 5;\n", |
824 | 825 | "\"\"\")" |
825 | 826 | ] |
826 | 827 | }, |
| 828 | + { |
| 829 | + "cell_type": "markdown", |
| 830 | + "id": "expose-view-intro", |
| 831 | + "metadata": {}, |
| 832 | + "source": [ |
| 833 | + "### Expose View for Nested Data\n", |
| 834 | + "BigQuery DataFrames now supports an expose view for columns containing nested data structures, such as structs, arrays, and arrays of structs. This feature flattens the nested data, presenting each field as a distinct column for improved readability and easier data analysis. For example, a column of structs will be expanded so that each key in the struct becomes its own column. Similarly, arrays are unnested, with each element appearing in a new row, making it simple to work with complex, multi-level data directly within the table." |
| 835 | + ] |
| 836 | + }, |
827 | 837 | { |
828 | 838 | "cell_type": "code", |
829 | 839 | "execution_count": 11, |
|
921 | 931 | "</div>[2 rows x 4 columns in total]" |
922 | 932 | ], |
923 | 933 | "text/plain": [ |
924 | | - " id struct_col array_col \\\n", |
| 934 | + " id struct_col array_col \\n", |
925 | 935 | "0 1 {'name': 'Alice', 'age': 30} [10 20 30] \n", |
926 | 936 | "1 2 {'name': 'Bob', 'age': 25} [40 50] \n", |
927 | 937 | "\n", |
|
0 commit comments