Αμαζόν Αθηνά είναι μια διαδραστική υπηρεσία ερωτημάτων που διευκολύνει την ανάλυση δεδομένων Απλή υπηρεσία αποθήκευσης Amazon (Amazon S3) and data sources residing in AWS, on-premises, or other cloud systems using SQL or Python. Athena is built on open-source Trino and Presto engines, and Apache Spark frameworks, with no provisioning or configuration effort required. Athena is serverless, so there is no infrastructure to manage, and you pay only for the queries that you run.
Παγόβουνο Apache is an open table format for very large analytic datasets. It manages large collections of files as tables, and it supports modern analytical data lake operations such as record-level insert, update, delete, and time travel queries. Athena supports read, time travel, write, and DDL queries for Apache Iceberg tables that use the Apache Parquet format for data and the Κατάλογος δεδομένων κόλλας AWS for their metastore.
Μηχανική χαρακτηριστικών is a process of identifying and transforming raw data (images, text files, videos, and so on), backfilling missing data, and adding one or more meaningful data elements to provide context so a machine learning (ML) model can learn from it. Data labeling is required for various use cases, including forecasting, computer vision, natural language processing, and speech recognition.
Combined with the capabilities of Athena, Apache Iceberg delivers a simplified workflow for data scientists to create new data features without needing to copy or recreate the entire dataset. You can create features using standard SQL on Athena without using any other service for feature engineering. Data scientists can reduce the time spent preparing and copying datasets, and instead focus on data feature engineering, experimentation, and analyzing data at scale.
In this post, we review the benefits of using Athena with the Apache Iceberg open table format and how it simplifies common feature engineering tasks for data scientists. We demonstrate how Athena can convert an existing table in Apache Iceberg format, then add columns, delete columns, and modify the data in the table without recreating or copying the dataset, and use these capabilities to create new features on Apache Iceberg tables.
Επισκόπηση λύσεων
Data scientists are generally accustomed to working with large datasets. Datasets are usually stored in either JSON, CSV, ORC, or Παρκέ Apache format, or similar read-optimized formats for fast read performance. Data scientists often create new data features, and backfill such data features with aggregated and ancillary data. Historically, this task was accomplished by creating a view on top of the table with the underlying data in Apache Parquet format, where such columns and data were added at runtime or by creating a new table with additional columns. Although this workflow is well-suited for many use cases, it’s inefficient for large datasets, because data would need to be generated at runtime or datasets would need to be copied and transformed.
Athena has introduced ACID (Atomicity, Consistency, Isolation, Durability) transaction capabilities that add INSERT, UPDATE, DELETE, MERGE, and time travel operations built on Apache Iceberg tables. These capabilities enable data scientists to create new data features and drop existing data features on existing datasets without worrying about copying or transforming the dataset or abstracting it with a view. Data scientists can focus on feature engineering work and avoid copying and transforming the datasets.
The Athena Iceberg UPDATE operation writes Apache Iceberg position delete files and newly updated rows as data files in the same transaction. You can make record corrections via a single UPDATE statement.
With the release of Athena engine version 3, the capabilities for Apache Iceberg tables are enhanced with the support for operations such as CREATE TABLE AS SELECT (CTAS) and MERGE commands that streamline the lifecycle management of your Iceberg data. CTAS makes it fast and efficient to create tables from other formats such as Apache Paquet, and MERGE INTO conditional updates, deletes, or inserts rows into an Iceberg table. A single statement can combine update, delete, and insert actions.
Προϋποθέσεις
Set up an Athena workgroup with Athena engine version 3 to use CTAS and MERGE commands with an Apache Iceberg table. To upgrade your existing Athena engine to version 3 in your Athena workgroup, follow the instructions in Κάντε αναβάθμιση στην έκδοση 3 του μηχανισμού Athena για να αυξήσετε την απόδοση ερωτημάτων και να αποκτήσετε πρόσβαση σε περισσότερες λειτουργίες αναλυτικών στοιχείων ή ανατρέξτε σε Changing the engine version in the Athena console.
Σύνολο δεδομένων
For demonstration, we use an Apache Parquet table that contains several million records of randomly distributed fictitious sales data from the last several years stored in an S3 bucket. Λήψη the dataset, unzip it to your local computer, and upload it to your S3 bucket. In this post, we uploaded our dataset to s3://sample-iceberg-datasets-xxxxxxxxxxx/sampledb/orders_and_customers/
.
The following table shows the layout for the table customer_orders
.
Όνομα στήλης | Τύπος δεδομένων | Περιγραφή |
orderkey | κορδόνι | Order number for the order |
custkey | κορδόνι | Customer identification number |
orderstatus | κορδόνι | Status of the order |
totalprice | κορδόνι | Total price of the order |
orderdate | κορδόνι | Date of the order |
orderpriority | κορδόνι | Priority of the order |
υπάλληλος | κορδόνι | Name of the clerk who processed the order |
shippriority | κορδόνι | Priority on the shipping |
όνομα | κορδόνι | Ονομα πελάτη |
διεύθυνση | κορδόνι | Διεύθυνση πελάτη |
nationkey | κορδόνι | Customer nation key |
τηλέφωνο | κορδόνι | Αριθμός τηλεφώνου πελάτη |
acctbal | κορδόνι | Customer account balance |
mktsegment | κορδόνι | Customer market segment |
Εκτελέστε μηχανική χαρακτηριστικών
As a data scientist, we want to perform μηχανική χαρακτηριστικών on the customer orders data by adding calculated one year total purchases and one year average purchases for each customer in the existing dataset. For demonstration purposes, we created the customer_orders
τραπέζι στο sampledb
database using Athena as shown in the following DDL command. (You can use any of your existing datasets and follow the steps mentioned in this post.) The customer_orders
dataset was generated and stored in the S3 bucket location s3://sample-iceberg-datasets-xxxxxxxxxxx/sampledb/orders_and_customers/
in Parquet format. This table is not an Apache Iceberg table.
Validate the data in the table by running a query:
We want to add new features to this table to get a deeper understanding of customer sales, which can result in faster model training and more valuable insights. To add new features to the dataset, convert the customer_orders
Athena table to Apache Iceberg table on Athena. Issue a CTAS query statement to create a new table with Apache Iceberg format from the customer_orders
table. While doing so, a new feature is added to get the total purchase amount in the past year (max year of the dataset) by each customer.
In the following CTAS query, a new column named one_year_sales_aggregate
with the default value as 0.0
of data type double
is added and table_type
έχει οριστεί σε ICEBERG
:
Issue the following query to verify the data in the Apache Iceberg table with the new column one_year_sales_aggregate
αξίες ως 0.0
:
We want to populate the values for the new feature one_year_sales_aggregate
in the dataset to get the total purchase amount for each customer based on their purchases in the past year (max year of the dataset). Issue a MERGE query statement to the Apache Iceberg table using Athena to populate values for the one_year_sales_aggregate
χαρακτηριστικό:
Issue the following query to validate the updated value for total spend by each customer in the past year:
We decide to add another feature onto an existing Apache Iceberg table to compute and store the average purchase amount in the past year by each customer. Issue an ALTER query statement to add a new column to an existing table for feature one_year_sales_average
:
Before populating the values to this new feature, you can set the default value for the feature one_year_sales_average
προς την 0.0
. Using the same Apache Iceberg table on Athena, issue an UPDATE query statement to populate the value for the new feature as 0.0
:
Issue the following query to verify the updated value for average spend by each customer in the past year is set to 0.0
:
Now we want to populate the values for the new feature one_year_sales_average
in the dataset to get the average purchase amount for each customer based on their purchases in the past year (max year of the dataset). Issue a MERGE query statement to the existing Apache Iceberg table on Athena using the Athena engine to populate values for the feature one_year_sales_average
:
Issue the following query to verify the updated values for average spend by each customer:
Once additional data features have been added to the dataset, data scientists generally proceed to train ML models and make inferences using Amazon Sagemaker or equivalent toolset.
Συμπέρασμα
In this post, we demonstrated how to perform feature engineering using Athena with Apache Iceberg. We also demonstrated using the CTAS query to create an Apache Iceberg table on Athena from an existing dataset in Apache Parquet format, adding new features in an existing Apache Iceberg table on Athena using the ALTER query, and using UPDATE and MERGE query statements to update the feature values of existing columns.
We encourage you to use CTAS queries to create tables quickly and efficiently, and use the MERGE query statement to synchronize tables in one step to simplify data preparations and update tasks when transforming the features using Athena with Apache Iceberg. If you have comments or feedback, please leave them in the comments section.
Σχετικά με τους Συγγραφείς
Vivek Gautam is a Data Architect with specialization in data lakes at AWS Professional Services. He works with enterprise customers building data products, analytics platforms, and solutions on AWS. When not building and designing modern data platforms, Vivek is a food enthusiast who also likes to explore new travel destinations and go on hikes.
Mikhail Vaynshteyn είναι αρχιτέκτονας λύσεων με τις υπηρεσίες Web της Amazon. Ο Mikhail συνεργάζεται με πελάτες της υγειονομικής περίθαλψης και των βιοεπιστημών για να δημιουργήσει λύσεις που βοηθούν στη βελτίωση των αποτελεσμάτων των ασθενών. Ο Mikhail ειδικεύεται στις υπηρεσίες ανάλυσης δεδομένων.
Naresh Gautam είναι ηγέτης Data Analytics και AI/ML στην AWS με 20 χρόνια εμπειρίας, ο οποίος απολαμβάνει να βοηθά τους πελάτες να αρχιτεκτονήσουν υψηλής διαθεσιμότητας, υψηλής απόδοσης και οικονομικά αποδοτικές αναλύσεις δεδομένων και λύσεις AI/ML για να ενδυναμώσουν τους πελάτες με τη λήψη αποφάσεων βάσει δεδομένων . Στον ελεύθερο χρόνο του, του αρέσει ο διαλογισμός και η μαγειρική.
Harsha Tadiparthi είναι ειδικός Principal Solutions Architect, Analytics στο AWS. Του αρέσει να λύνει σύνθετα προβλήματα πελατών σε βάσεις δεδομένων και αναλυτικά στοιχεία και να παρέχει επιτυχημένα αποτελέσματα. Εκτός δουλειάς, του αρέσει να περνά χρόνο με την οικογένειά του, να βλέπει ταινίες και να ταξιδεύει όποτε είναι δυνατόν.
- SEO Powered Content & PR Distribution. Ενισχύστε σήμερα.
- EVM Finance. Ενιαία διεπαφή για αποκεντρωμένη χρηματοδότηση. Πρόσβαση εδώ.
- Quantum Media Group. Ενισχυμένο IR/PR. Πρόσβαση εδώ.
- PlatoAiStream. Web3 Data Intelligence. Ενισχύθηκε η γνώση. Πρόσβαση εδώ.
- πηγή: https://aws.amazon.com/blogs/big-data/accelerate-data-science-feature-engineering-on-transactional-data-lakes-using-amazon-athena-with-apache-iceberg/
- :έχει
- :είναι
- :δεν
- :που
- $UP
- 10
- 100
- 12
- 17
- 20
- 20 χρόνια
- 23
- 27
- 7
- a
- Σχετικα
- επιταχύνουν
- πρόσβαση
- επιτυγχάνεται
- Λογαριασμός
- ενεργειών
- προσθέτω
- προστιθέμενη
- προσθήκη
- Πρόσθετος
- διεύθυνση
- AI / ML
- Επίσης
- Αν και
- Amazon
- Αμαζόν Αθηνά
- Amazon Sage Maker
- Amazon υπηρεσίες Web
- ποσό
- an
- Αναλυτικός
- Αναλυτικός
- analytics
- αναλύσει
- αναλύοντας
- και
- Άλλος
- κάθε
- Apache
- Apache Spark
- ΕΙΝΑΙ
- AS
- At
- διαθέσιμος
- μέσος
- αποφύγετε
- AWS
- Επαγγελματικές υπηρεσίες AWS
- βασίζονται
- BE
- επειδή
- ήταν
- οφέλη
- χτίζω
- Κτίριο
- χτισμένο
- by
- υπολογίζεται
- CAN
- δυνατότητες
- περιπτώσεις
- ταξινόμηση
- Backup
- συλλογές
- Στήλη
- Στήλες
- συνδυασμός
- σχόλια
- Κοινός
- συγκρότημα
- Υπολογίστε
- υπολογιστή
- Computer Vision
- διαμόρφωση
- Περιέχει
- συμφραζόμενα
- μετατρέψετε
- μαγείρεμα
- αντιγραφή
- Διορθώσεις
- αποδοτική
- δημιουργία
- δημιουργήθηκε
- δημιουργία
- πελάτης
- Πελάτες
- ημερομηνία
- Δεδομένα Analytics
- Λίμνη δεδομένων
- επιστημονικά δεδομένα
- επιστήμονας δεδομένων
- βασίζονται σε δεδομένα
- βάση δεδομένων
- βάσεις δεδομένων
- σύνολα δεδομένων
- Ημερομηνία
- αποφασίζει
- Λήψη Αποφάσεων
- βαθύτερη
- Προεπιλογή
- παράδοση
- παραδίδει
- αποδεικνύουν
- κατέδειξε
- σχέδιο
- προορισμοί
- διανέμονται
- πράξη
- διπλασιαστεί
- Πτώση
- αντοχή
- κάθε
- εύκολος
- αποτελεσματικός
- αποτελεσματικά
- προσπάθεια
- είτε
- στοιχεία
- εξουσιοδοτώ
- ενεργοποιήσετε
- ενθαρρύνει
- Κινητήρας
- Μηχανική
- Κινητήρες
- ενισχυμένη
- Εταιρεία
- επιχειρηματικούς πελάτες
- θιασώτης
- Ολόκληρος
- Ισοδύναμος
- Αιθέρας (ΕΤΗ)
- υφιστάμενα
- εμπειρία
- διερευνήσει
- εξωτερικός
- ψευδής
- οικογένεια
- FAST
- γρηγορότερα
- Χαρακτηριστικό
- Χαρακτηριστικά
- ανατροφοδότηση
- Αρχεία
- Συγκέντρωση
- ακολουθήστε
- Εξής
- τροφή
- Για
- μορφή
- πλαισίων
- Δωρεάν
- από
- γενικά
- παράγεται
- παίρνω
- Go
- Group
- Hadoop
- Έχω
- he
- υγειονομική περίθαλψη
- βοήθεια
- βοήθεια
- υψηλή απόδοση
- υψηλά
- Πεζοπορίες
- του
- ιστορικά
- Κυψέλη
- Πως
- Πώς να
- HTML
- HTTPS
- Αναγνώριση
- προσδιορισμό
- if
- εικόνες
- βελτίωση
- in
- Συμπεριλαμβανομένου
- Αυξάνουν
- ανεπαρκής
- Υποδομή
- Ένθετα
- ιδέες
- αντί
- οδηγίες
- διαδραστικό
- σε
- εισήγαγε
- απομόνωση
- ζήτημα
- IT
- jpg
- json
- τιτλοφόρηση
- λίμνη
- Γλώσσα
- large
- Επίθετο
- σχέδιο
- ηγέτης
- ΜΑΘΑΊΝΩ
- μάθηση
- Άδεια
- ζωή
- Επιστήμες της Ζωής
- κύκλος ζωής
- LIMIT
- τοπικός
- τοποθεσία
- αγαπά
- μηχανή
- μάθηση μηχανής
- κάνω
- ΚΑΝΕΙ
- διαχείριση
- διαχείριση
- διαχειρίζεται
- πολοί
- αγορά
- συμφωνημένα
- max
- νόημα
- Διαλογισμός
- που αναφέρθηκαν
- πηγαίνω
- εκατομμύριο
- Λείπει
- ML
- μοντέλο
- μοντέλα
- ΜΟΝΤΕΡΝΑ
- τροποποιήσει
- περισσότερο
- Κινηματογράφος
- όνομα
- Ονομάστηκε
- έθνος
- Φυσικό
- Φυσική γλώσσα
- Επεξεργασία φυσικής γλώσσας
- Ανάγκη
- χρειάζονται
- Νέα
- νέα δυνατότητα
- Νέες δυνατότητες
- πρόσφατα
- Όχι.
- αριθμός
- of
- συχνά
- on
- ONE
- αποκλειστικά
- ανοίξτε
- ανοικτού κώδικα
- λειτουργία
- λειτουργίες
- or
- παραγγελιών
- ΑΛΛΑ
- δικός μας
- αποτελέσματα
- εκτός
- Το παρελθόν
- Πληρωμή
- εκτελέσει
- επίδοση
- τηλέφωνο
- Πλατφόρμες
- Πλάτων
- Πληροφορία δεδομένων Plato
- Πλάτωνα δεδομένα
- σας παρακαλούμε
- θέση
- δυνατός
- Θέση
- προετοιμασία
- τιμή
- Κύριος
- προβλήματα
- διαδικασια μας
- επεξεργασία
- μεταποίηση
- Προϊόντα
- επαγγελματίας
- παρέχουν
- αγορά
- ψώνια
- σκοποί
- Python
- ερωτήματα
- γρήγορα
- Ακατέργαστος
- ακατέργαστα δεδομένα
- Διάβασε
- αναγνώριση
- ρεκόρ
- αρχεία
- μείωση
- απελευθερώνουν
- απαιτείται
- αποτέλεσμα
- ανασκόπηση
- ΣΕΙΡΑ
- τρέξιμο
- τρέξιμο
- σοφός
- εμπορικός
- ίδιο
- Κλίμακα
- Επιστήμη
- ΕΠΙΣΤΗΜΕΣ
- Επιστήμονας
- επιστήμονες
- Τμήμα
- Χωρίς διακομιστή
- υπηρεσία
- Υπηρεσίες
- σειρά
- διάφοροι
- παρουσιάζεται
- Δείχνει
- παρόμοιες
- Απλούς
- απλοποιημένη
- απλοποίηση
- ενιαίας
- So
- Λύσεις
- Επίλυση
- Πηγές
- Σπινθήρας
- ειδικός
- ειδικεύεται
- ομιλία
- Αναγνώριση ομιλίας
- δαπανήσει
- πέρασε
- SQL
- πρότυπο
- Δήλωση
- δηλώσεις
- Βήμα
- Βήματα
- χώρος στο δίσκο
- κατάστημα
- αποθηκεύονται
- εξορθολογισμό
- Σπάγγος
- επιτυχής
- τέτοιος
- υποστήριξη
- Υποστηρίζει
- συστήματα
- τραπέζι
- Έργο
- εργασίες
- ότι
- Η
- Η συγχώνευση
- τους
- Τους
- τότε
- Εκεί.
- Αυτοί
- αυτό
- ώρα
- ταξίδι στο χρόνο
- προς την
- κορυφή
- Σύνολο
- Τρένο
- Εκπαίδευση
- συναλλαγή
- συναλλακτική
- μετασχηματίζεται
- μετασχηματίζοντας
- ταξίδι
- τύπος
- υποκείμενες
- κατανόηση
- Ενημέρωση
- ενημερώθηκε
- ενημερώσεις
- αναβάθμισης
- Φορτώθηκε
- χρήση
- χρησιμοποιώντας
- συνήθως
- ΕΠΙΚΥΡΩΝΩ
- Πολύτιμος
- αξία
- Αξίες
- διάφορα
- επαληθεύει
- εκδοχή
- πολύ
- μέσω
- Βίντεο
- Δες
- όραμα
- θέλω
- ήταν
- Δες
- we
- ιστός
- διαδικτυακές υπηρεσίες
- ήταν
- πότε
- οποτεδήποτε
- Ποιό
- ενώ
- Ο ΟΠΟΊΟΣ
- με
- χωρίς
- Εργασία
- ροής εργασίας
- Ομάδα εργασίας
- εργαζόμενος
- λειτουργεί
- θα
- γράφω
- έτος
- χρόνια
- εσείς
- Σας
- zephyrnet
- Zip