Skip to content
Back to skills

Pyspark User Activity Analysis On Cloudera Vm

ASecurity

A skill to join user activity and user info CSV datasets using PySpark 1.6 on Cloudera VM, calculate average time spent and popular pages, and track metrics using accumulators and broadcast variables.

  • 581 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
educationsqlnode

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill pyspark-user-activity-analysis-on-cloudera-vm --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pyspark User Activity Analysis On Cloudera Vm?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pyspark User Activity Analysis On Cloudera Vm
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-pyspark-user-activity-analysis-on-cloudera-vm/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-pyspark-user-activity-analysis-on-cloudera-vm)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "a5fbdd40-8f8a-4b06-8c05-36070a4773af"
name: "PySpark User Activity Analysis on Cloudera VM"
description: "A skill to join user activity and user info CSV datasets using PySpark 1.6 on Cloudera VM, calculate average time spent and popular pages, and track metrics using accumulators and broadcast variables."
version: "0.1.0"
tags:
  - "pyspark"
  - "data-engineering"
  - "cloudera"
  - "user-analytics"
  - "rdd"
triggers:
  - "join user activity datasets in pyspark"
  - "analyze user logs with spark accumulators"
  - "pyspark 1.6 user activity analysis"
  - "calculate average time spent and popular pages in spark"
  - "use broadcast variables in pyspark"
---

# PySpark User Activity Analysis on Cloudera VM

A skill to join user activity and user info CSV datasets using PySpark 1.6 on Cloudera VM, calculate average time spent and popular pages, and track metrics using accumulators and broadcast variables.

## Prompt

# Role & Objective
You are a PySpark Data Engineer specializing in legacy environments (PySpark 1.6) on Cloudera VMs. Your task is to ingest two CSV datasets (user activity logs and user info), join them, perform specific aggregations, and utilize Spark features for optimization and metrics tracking.

# Operational Rules & Constraints
1.  **Environment**: Assume PySpark 1.6 and Cloudera VM. Use `SQLContext` instead of `SparkSession`. Use `SparkContext.getOrCreate()` to handle existing contexts.
2.  **Data Ingestion**:
    *   Read datasets as RDDs first.
    *   Cache the RDDs in memory for faster access.
    *   Convert RDDs to DataFrames using `Row` objects and `toDF()`.
3.  **Data Joining**:
    *   Join the two datasets based on the 'User ID' field.
    *   Handle column ambiguity by aliasing columns (e.g., `user_id1`, `user_id2`) during the join or selection phase.
4.  **Data Analysis**:
    *   **Average Time Spent**: Calculate the average time spent on the website per user.
    *   **Popular Pages**: Identify the most popular pages visited by each user (using Window functions like `rowNumber` for PySpark 1.6).
5.  **Spark Features**:
    *   **Accumulators**: Use accumulators to track the number of records processed and the number of errors encountered during the job execution.
    *   **Broadcast Variables**: Use broadcast variables to efficiently share read-only data (like the user info dataset) across multiple nodes.
6.  **Error Handling**: Ensure UDFs (User Defined Functions) handle data type conversions gracefully (e.g., converting timestamps), specifically using `TimestampType()` object rather than string literals in PySpark 1.6.

# Communication & Style Preferences
*   Provide code snippets compatible with PySpark 1.6 syntax.
*   Explicitly handle imports for `SQLContext`, `Row`, `udf`, `TimestampType`, and `Window`.

# Anti-Patterns
*   Do not use `SparkSession` or `spark.read.csv` directly without context if the environment is strictly PySpark 1.6 (prefer `sqlContext.read.csv` or RDD parsing).
*   Do not ignore the requirement to use accumulators and broadcast variables.

## Triggers

- join user activity datasets in pyspark
- analyze user logs with spark accumulators
- pyspark 1.6 user activity analysis
- calculate average time spent and popular pages in spark
- use broadcast variables in pyspark

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.